Make WordPress Core


Ignore:
Timestamp:
07/09/2015 08:55:26 PM (11 years ago)
Author:
wonderboymusic
Message:

Revert [32851] and [32850] for now, tl;dr encoding issues.

See #17780.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/WPSpecialchars.php

    r32851 r33148  
    1818                // Allowed entities should be unchanged
    1919                foreach ( $allowedentitynames as $ent ) {
    20                         if ( 'apos' == $ent ) {
    21                                 // But for some reason, PHP doesn't allow '
    22                                 continue;
    23                         }
    2420                        $ent = '&' . $ent . ';';
    2521                        $this->assertEquals( $ent, _wp_specialchars( $ent ) );
    … …  
    4440                $this->assertEquals( $source, _wp_specialchars($source) );
    4541        }
    46 
    47         /**
    48          * Check some of the double-encoding features for entity references.
    49          *
    50          * @ticket 17780
    51          * @dataProvider data_double_encoding
    52          */
    53         function test_double_encoding( $input, $output ) {
    54                 return $this->assertEquals( $output, _wp_specialchars( $input, ENT_NOQUOTES, false, true ) );
    55         }
    56 
    57         function data_double_encoding() {
    58                 return array(
    59                         array(
    60                                 'This & that, this & that, — " " Ú   " " " " " $ ×',
    61                                 'This & that, this & that, — " " Ú   " " " " " $ ×',
    62                         ),
    63                         array(
    64                                 '&& && && &;',
    65                                 '&& && && &;',
    66                         ),
    67                         array(
    68                                 '&garbage; &***; &aaaa; &0000; &####; &;;',
    69                                 '&garbage; &***; &aaaa; &0000; &####; &;;',
    70                         ),
    71                 );
    72         }
    73 
    74         /**
    75          * Check some of the double-encoding features for entity references.
    76          *
    77          * @ticket 17780
    78          * @dataProvider data_no_double_encoding
    79          */
    80         function test_no_double_encoding( $input, $output ) {
    81                 return $this->assertEquals( $output, _wp_specialchars( $input, ENT_NOQUOTES, false, false ) );
    82         }
    83 
    84         function data_no_double_encoding() {
    85                 return array(
    86                         array(
    87                                 'This & that, this & that, — " " Ú   " " " " " $ ×',
    88                                 'This & that, this & that, — " " Ú   " " " " " $ ×',
    89                         ),
    90                         array(
    91                                 '&& && && &;',
    92                                 '&& && && &;',
    93                         ),
    94                         array(
    95                                 '&garbage; &***; &aaaa; &0000; &####; &;;',
    96                                 '&garbage; &***; &aaaa; &0000; &####; &;;',
    97                         ),
    98                 );
    99         }
    10042}
Note: See TracChangeset for help on using the changeset viewer.