WordPress.org

Make WordPress Core

Ticket #15241: patch-incl-fixed-unit-test.diff

File patch-incl-fixed-unit-test.diff, 1.5 KB (added by norbertm, 3 years ago)
  • wp-testcase/test_includes_formatting.php

     
    403403                $this->assertEquals('‘test’s quoted’', wptexturize('\'test\'s quoted\'')); 
    404404                $this->assertEquals('“test’s quoted”', wptexturize('"test\'s quoted"')); 
    405405        } 
    406          
     406 
     407        //WP Tickets #4539, #15241 
     408        function test_full_sentences_with_unmatched_single_quotes() { 
     409                $this->assertEquals( 
     410                        'That means every moment you’re working on something without it being in the public it’s actually dying.', 
     411                        wptexturize("That means every moment you're working on something without it being in the public it's actually dying.") 
     412                ); 
     413        } 
     414 
    407415        //WP Ticket #4539 
    408416        function test_quotes() { 
    409417                $this->knownWPBug(4539); 
  • wordpress/wp-includes/formatting.php

     
    6161                         
    6262                        '/\'([^\']*)\'([^\']*)\'/' => '‘$1’$2’', // 'test's' 
    6363                         
     64                        '/(\w)\'(\w)/' => '$1’$2', // test's 
     65 
    6466                        '/\'([^\']*)\'/' => '‘$1’', // 'asd' 
    6567                        '/"([^"]*)"/' => $opening_quote . '$1' . $closing_quote, // "qwe" 
    6668                         
    67                         '/(\w)\'(\w)/' => '$1’$2', // test's 
    68                          
    6969                        '/(\d)"/' => '$1″', // 9" -> 9″ 
    7070                        '/(\d)\'/' => '$1′', // 9' -> 9′ 
    7171