WordPress.org

Make WordPress Core

Ticket #3065: patch2.txt

File patch2.txt, 1.4 KB (added by murky, 8 years ago)

Second try at the patch (should be 'neater', but untested)

Line 
1Index: wp-includes/formatting.php
2===================================================================
3--- wp-includes/formatting.php  (revision 4150)
4+++ wp-includes/formatting.php  (working copy)
5@@ -116,6 +116,13 @@
6        return $text;
7 }
8 
9+function amp( $url ) {
10+
11+      $url = str_replace("&", "&", $url);
12+      $url = str_replace("&", "&", $url);
13+      return $url;
14+}
15+
16 function utf8_uri_encode( $utf8_string ) {
17   $unicode = '';       
18   $values = array();
19Index: wp-includes/feed.php
20===================================================================
21--- wp-includes/feed.php        (revision 4150)
22+++ wp-includes/feed.php        (working copy)
23@@ -59,11 +59,15 @@
24 }
25 
26 function permalink_single_rss($file = '') {
27-    echo get_permalink();
28+    $url = get_permalink();
29+    $url = amp($url);
30+    echo $url;
31 }
32 
33 function comment_link() {
34-       echo get_comment_link();
35+      $url = get_comment_link();
36+      $url = amp($url);
37+       echo amp($url);
38 }
39 
40 function get_comment_author_rss() {
41Index: wp-includes/comment-template.php
42===================================================================
43--- wp-includes/comment-template.php    (revision 4150)
44+++ wp-includes/comment-template.php    (working copy)
45@@ -138,7 +138,9 @@
46 }
47 
48 function get_comments_link() {
49-       return get_permalink() . '#comments';
50+      $url = get_permalink();
51+      $url = amp($url);
52+       return amp($url) . '#comments';
53 }
54 
55 function comments_link( $file = '', $echo = true ) {