WordPress.org

Make WordPress Core

Ticket #25280: 2580.3.patch

File 2580.3.patch, 584 bytes (added by c3mdigital, 5 years ago)

Only run strings through html_entity_decode

  • wp-includes/class.wp-scripts.php

     
    161161                }
    162162
    163163                foreach ( (array) $l10n as $key => $value ) {
    164                         if ( !is_scalar($value) )
     164                        if ( !is_string($value) )
    165165                                continue;
    166166
    167                         $l10n[$key] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8');
     167                        $l10n[$key] = html_entity_decode( $value, ENT_QUOTES, 'UTF-8');
    168168                }
    169169
    170170                $script = "var $object_name = " . json_encode($l10n) . ';';