Index: trunk/phase3/includes/Parser.php |
— | — | @@ -3249,12 +3249,27 @@ |
3250 | 3250 | * @return string Text |
3251 | 3251 | */ |
3252 | 3252 | function cleanSig( $text ) { |
3253 | | - $text = str_replace( '{{', '{{subst:', $text ); |
3254 | | - $text = str_replace( '{{subst:subst:', '{{subst:', $text ); |
3255 | | - $text = str_replace( '~~~', '', $text ); |
3256 | | - $text = str_replace( '~~~~', '', $text ); |
3257 | | - $text = str_replace( '~~~~~', '', $text ); |
3258 | | - return( $text ); |
| 3253 | + $mw = MagicWord::get( MAG_SUBST ); |
| 3254 | + $substre = $mw->getBaseRegex(); |
| 3255 | + $subst = $mw->getSynonym( 0 ); |
| 3256 | + $i = $mw->getRegexCase(); |
| 3257 | + |
| 3258 | + $text = preg_replace( |
| 3259 | + "/ |
| 3260 | + \{\{ |
| 3261 | + (?! |
| 3262 | + (?: |
| 3263 | + $substre |
| 3264 | + ) |
| 3265 | + ) |
| 3266 | + /x$i", |
| 3267 | + '{{' . $subst, |
| 3268 | + $text |
| 3269 | + ); |
| 3270 | + |
| 3271 | + $text = preg_replace( '/~{3,5}/', '', $text ); |
| 3272 | + |
| 3273 | + return $text; |
3259 | 3274 | } |
3260 | 3275 | |
3261 | 3276 | /** |