Index: trunk/extensions/redircite/redircite.php |
— | — | @@ -1,7 +1,5 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -die("redircite extension disabled -- contains HTML injection vulnerabilities."); |
5 | | - |
6 | 4 | /** |
7 | 5 | * This program is free software; you can redistribute it and/or modify |
8 | 6 | * it under the terms of the GNU General Public License as published by |
— | — | @@ -50,11 +48,15 @@ |
51 | 49 | // which will be translated to the HTML stored in $redirciteMarkerList by |
52 | 50 | // redircite_afterTidy() |
53 | 51 | global $redirciteMarkerList; |
| 52 | + # Verify that $input is a valid title |
| 53 | + $inputTitle = Title::newFromText($input); |
| 54 | + if(!$inputTitle) |
| 55 | + return $input; |
54 | 56 | $lparse = clone $parser; |
55 | 57 | $link1 = $lparse->parse("[[$input]]", $parser->mTitle, $parser->mOptions, false, false); |
56 | 58 | $link1text = $link1->getText(); |
57 | 59 | $title1 = Title::newFromText($input); |
58 | | - if(!$title1) // Page doesn't exist |
| 60 | + if(!$title1->exists()) // Page doesn't exist |
59 | 61 | // Just output a normal (red) link |
60 | 62 | return $link1text; |
61 | 63 | $articleObj = new Article($title1); |