escaping was not needed at all to process short urls. Real fix.

darcs-hash:20081114195457-099f7-45f4f39d5f2eff980d903ca156170576323ec4a7.gz
This commit is contained in:
millette 2008-11-14 14:54:57 -05:00
parent 1227c9c2c2
commit 0275676931

View File

@ -761,12 +761,10 @@ function common_longurl($uri) {
} }
function common_shorten_links($text) { function common_shorten_links($text) {
$r = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8');
// \s = not a horizontal whitespace character (since PHP 5.2.4) // \s = not a horizontal whitespace character (since PHP 5.2.4)
// RYM this should prevent * preceded URLs from being processed but it its a char // RYM this should prevent * preceded URLs from being processed but it its a char
// $r = preg_replace('@[^*](https?://[^)\]>\s]+)@e', "common_shorten_link('\\1')", $r); // $r = preg_replace('@[^*](https?://[^)\]>\s]+)@e', "common_shorten_link('\\1')", $r);
$r = preg_replace('@https?://[^)\]>\s]+@e', "common_shorten_link('\\0')", $r); return preg_replace('@https?://[^)\]>\s]+@e', "common_shorten_link('\\0')", $text);
return $r;
} }
function common_shorten_link($long_url) { function common_shorten_link($long_url) {