biow0lf / evedev-kb

Automatically exported from code.google.com/p/evedev-kb
1 stars 0 forks source link

class.comments.php bugs #153

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, [pilot=XXX]hurf[/pilot] and [kill=XXX]blurf[/kill] will not generate 
the proper links in the comments.

The link generated has a spurious slash which breaks the link.

This is on the trunk revision of class.comments.php.

Here is the diff for the changes to make it work:

Index: class.comments.php
===================================================================
--- class.comments.php  (revision 1264)
+++ class.comments.php  (working copy)
@@ -110,8 +110,8 @@
         $string = str_replace(array('[b]','[/b]','[i]','[/i]','[u]','[/u]'),
                               array('<b>','</b>','<i>','</i>','<u>','</u>'), $string);
         $string = preg_replace('^\[color=(.*?)](.*?)\[/color]^', '<span style="color:\1">\2</span>', $string);
-        $string = preg_replace('^\[kill=(.*?)](.*?)\[/kill]^', '<a 
href="\?a=kill_detail&amp;kll_id=\1">\2</a>', $string);
-        $string = preg_replace('^\[pilot=(.*?)](.*?)\[/pilot]^', '<a 
href="\?a=pilot_detail&amp;plt_id=\1">\2</a>', $string);
+        $string = preg_replace('^\[kill=(.*?)](.*?)\[/kill]^', '<a 
href="?a=kill_detail&amp;kll_id=\1">\2</a>', $string);
+        $string = preg_replace('^\[pilot=(.*?)](.*?)\[/pilot]^', '<a 
href="?a=pilot_detail&amp;plt_id=\1">\2</a>', $string);
         return nl2br(addslashes($string));
     }
 }
\ No newline at end of file

Original issue reported on code.google.com by jjl...@gmail.com on 7 Apr 2011 at 6:04

GoogleCodeExporter commented 9 years ago
Your fix works for me so I'm applying it. Nice bug report! :)

Original comment by kovellia on 8 Apr 2011 at 9:35

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1266.

Original comment by kovellia on 8 Apr 2011 at 9:35