Req #9127 [NEW]: extending make_ticket_links() matched words

From: Date: Sat, 21 Oct 2006 22:14:25 +0000
Subject: Req #9127 [NEW]: extending make_ticket_links() matched words
Groups: php.pear.webmaster 
Request: Send a blank email to pear-webmaster+get-5351@lists.php.net to get a copy of this message
From: l dot alberton at quipo dot it Operating system: Package version: PHP version: 5.1.0 Package: Web Site Bug Type: Feature/Change Request Bug description: extending make_ticket_links() matched words Description: ------------ Attached, a patch to pearweb/include/pear-format-html.php containing a change to the regexp in make_ticket_links() to match these cases: bugfix XXX bug XXX req XXX request XXX At the moment, only these are supported: bug XXX request XXX Test script: --------------- --- /tmp/pear-format-html.1.191.php Sat Oct 21 12:18:11 2006 +++ /CVS_repository/pearweb/include/pear-format-html.php Sat Oct 21 12:18:02 2006 @@ -1142,10 +1142,10 @@ */ function make_ticket_links($text) { - $text = preg_replace('/(?<=php)\s*(bug|request)\s+#?([0-9]+)/i', + $text = preg_replace('/(?<=php)\s*(bug(?:fix)?|req(?:uest)?)\s+#?([0-9]+)/i', ' <a href="http://bugs.php.net/\\2">\\1 \\2</a>', $text); - $text = preg_replace('/(?<![>a-z])(bug|request)\s+#?([0-9]+)/i', + $text = preg_replace('/(?<![>a-z])(bug(?:fix)?|req(?:uest)?)\s+#?([0-9]+)/i', '<a href="/bugs/\\2">\\0</a>', $text); return $text; } -- Edit bug report at http://pear.php.net/bugs/bug.php?id=9127&edit=1 --

« previous php.pear.webmaster (#5351) next »