WordPress.org

Make WordPress Core

Opened 3 months ago

#47663 new defect (bug)

add_magic_quotes function transforms int to string

Reported by: mickaelperrin Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:
PR Number:

Description

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,

Change History (0)

Note: See TracTickets for help on using tickets.