Bug in 2.4 generates multiple PHP error log entries per page load
-
On line
19
ofquick-adsense/includes/widgets.php
you callget_the_content()
. If theglobal $pages
variable is not an array, PHP will generate the following error message in the error log:PHP Warning: count(): Parameter must be an array or an object that implements Countable in /home/soapdirt/public_html/wp-includes/post-template.php on line 284
The log was 2GB in size when a client asked me to look at some problems in their site. The “quick fix” (see what I did there?) is to simply add the following before line
19
ofquick-adsense/includes/widgets.php
:global $pages; if ( !isset( $pages ) || !is_array( $pages ) ) { $pages = array(); }
I am hoping you will do this before your next release so that the client upgrading won’t cause the problem to recur.
- This topic was modified 5 years, 3 months ago by . Reason: formatting
- This topic was modified 5 years, 3 months ago by .
- This topic was modified 5 years, 3 months ago by .
- This topic was modified 5 years, 3 months ago by . Reason: formatting
- This topic was modified 5 years, 3 months ago by . Reason: fix wrong line #
The page I need help with: [log in to see the link]
- The topic ‘Bug in 2.4 generates multiple PHP error log entries per page load’ is closed to new replies.