Opened 10 years ago
Closed 10 years ago
#28582 closed defect (bug) (fixed)
Global declaration needed for variables in kses.php
Reported by: | Jaza613 | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | Formatting | Keywords: | has-patch |
Focuses: | Cc: |
Description
In 'wp-includes/kses.php', the three variables '$allowedposttags, $allowedtags, $allowedentitynames' are declared within an 'if' statement. Under normal circumstances, they end up in the global context as they should.
However, if the current PHP environment uses namespaces / autoload, they seem to not get added, resulting in this error:
Warning: in_array() expects parameter 2 to be array, null given in /path/to/wp-includes/kses.php line 1176
(Line 1176 is:)
return ( ( ! in_array($i, $allowedentitynames) ) ? "&$i;" : "&$i;" );
Attached patch fixes the issue, by declaring these variables with the 'global' keyword before assigning them a value.
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
In 28845: