Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#47663 closed defect (bug) (duplicate)

add_magic_quotes function transforms int to string

Reported by: mickaelperrin's profile mickaelperrin Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:



I try to implement codecoverage of a WordPress module using

The coverage fails with the following error:

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:

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


Change History (3)

#2 @jrf
4 years ago

@mickaelperrin Thanks for bringing this up.

Even though this is an earlier ticket, I think this should be marked as a duplicate of #48605 which now has some potential patches for this issue. Or should it be the other way around and should I upload those patches here @SergeyBiryukov ?

#3 @SergeyBiryukov
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Agreed, let's continue the discussion in #48605.

Note: See TracTickets for help on using tickets.