WordPress.org

Make WordPress Core

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

File patch-incl-fixed-unit-test.txt, 1.5 KB (added by norbertm, 3 years ago)
Line 
1Index: wp-testcase/test_includes_formatting.php
2===================================================================
3--- wp-testcase/test_includes_formatting.php    (revision 318)
4+++ wp-testcase/test_includes_formatting.php    (working copy)
5@@ -403,7 +403,15 @@
6                $this->assertEquals('‘test’s quoted’', wptexturize('\'test\'s quoted\''));
7                $this->assertEquals('“test’s quoted”', wptexturize('"test\'s quoted"'));
8        }
9-       
10+
11+       //WP Tickets #4539, #15241
12+       function test_full_sentences_with_unmatched_single_quotes() {
13+               $this->assertEquals(
14+                       'That means every moment you’re working on something without it being in the public it’s actually dying.',
15+                       wptexturize("That means every moment you're working on something without it being in the public it's actually dying.")
16+               );
17+       }
18+
19        //WP Ticket #4539
20        function test_quotes() {
21                $this->knownWPBug(4539);
22Index: wordpress/wp-includes/formatting.php
23===================================================================
24--- wordpress/wp-includes/formatting.php        (revision 16376)
25+++ wordpress/wp-includes/formatting.php        (working copy)
26@@ -61,11 +61,11 @@
27                       
28                        '/\'([^\']*)\'([^\']*)\'/' => '‘$1’$2’', // 'test's'
29                       
30+                       '/(\w)\'(\w)/' => '$1’$2', // test's
31+
32                        '/\'([^\']*)\'/' => '‘$1’', // 'asd'
33                        '/"([^"]*)"/' => $opening_quote . '$1' . $closing_quote, // "qwe"
34                       
35-                       '/(\w)\'(\w)/' => '$1’$2', // test's
36-                       
37                        '/(\d)"/' => '$1″', // 9" -> 9″
38                        '/(\d)\'/' => '$1′', // 9' -> 9′
39