[wp-trac] [WordPress Trac] #47663: add_magic_quotes function transforms int to string

WordPress Trac noreply at wordpress.org
Mon Jul 8 09:41:24 UTC 2019


#47663: add_magic_quotes function transforms int to string
---------------------------+-----------------------------
 Reporter:  mickaelperrin  |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  General        |    Version:
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 Hi,

 I try to implement codecoverage of a WordPress module using
 https://github.com/sebastianbergmann/php-code-coverage.

 The coverage fails with the following error:

 FATAL ERROR. TESTS NOT FINISHED.
 Uncaught TypeError: date() expects parameter 2 to be int, string given in
 /src/vendor/phpunit/php-code-coverage/src/Report/Html/Facade.php:63

 The problem seems to be related to the function add_magic_quotes that
 converts int to string by calling addslashes on everything in $_SERVER.

 It looks like type hinting in the test library won't be implemented:
 https://github.com/sebastianbergmann/php-code-coverage/issues/669

 Does a type check on the add_magic_quotes function could be implemented
 without breaking other things?

 Thanks,

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


More information about the wp-trac mailing list