[wp-trac] [WordPress Trac] #33524: json_encode giving invalid UTF-8 sequence followed by maxed CPU's

WordPress Trac noreply at wordpress.org
Sun Aug 23 23:09:42 UTC 2015


#33524: json_encode giving invalid UTF-8 sequence followed by maxed CPU's
--------------------------+-----------------------------
 Reporter:  thehrisworld  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.3
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Linux (latest version and updates from AWS)
 Apache 2.2.31
 PHP  5.3.29
 MySQL 5.5.42

 RE:
 PHP Warning: json_encode(): Invalid UTF-8 sequence in argument in
 /var/www/html/wp-includes/functions.php

 The above error couldn't be resolved until we rolled back to WP 4.2.4 from
 4.3 -- the lines of code involved (2655-2667):


 {{{

 function wp_json_encode( $data, $options = 0, $depth = 512 ) {
         /*
          * json_encode() has had extra params added over the years.
          * $options was added in 5.3, and $depth in 5.5.
          * We need to make sure we call it with the correct arguments.
          */
         if ( version_compare( PHP_VERSION, '5.5', '>=' ) ) {
                 $args = array( $data, $options, $depth );
         } elseif ( version_compare( PHP_VERSION, '5.3', '>=' ) ) {
                 $args = array( $data, $options );
         } else {
                 $args = array( $data );
         }

 }}}

 We would receive the error notice several times in the httpd error_log,
 even with all plugins deactivated (even moved them to a tmp directory just
 to be sure). This was accompanied by our CPU's maxing out followed by
 crashing. Truthfully, we have no clue if this is the cause however our
 actions noted above stopped the error as well as stabilized the server.

 We have setup a test environment but have not completed it yet to see if
 this error persists with the latest version for all four systems (LAMP)...

 Please advise what to do next -- again, we believe our site is stabilized
 with the rollback to WP 4.2.4...

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33524>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list