No more strip the whole text when magicword #REDIRECT is found in a text.
Let you categorize redirects but might let some vandals use #REDIRECT in the
middle of a text.
}
$isminor = ( $minor && $wgUser->isLoggedIn() );
- if ( $this->isRedirect( $text ) ) {
- # Remove all content but redirect
- # This could be done by reconstructing the redirect from a title given by
- # Title::newFromRedirect(), but then we wouldn't know which synonym the user
- # wants to see
- if ( preg_match( "/^((" . $wgMwRedir->getBaseRegex() . ')[^\\n]+)/i', $text, $m ) ) {
- $redir = 1;
- $text = $m[1] . "\n";
- }
- }
- else { $redir = 0; }
+ $redir = $this->isRedirect( $text ) ? 1 : 0;
$text = $this->preSaveTransform( $text );
$dbw =& wfGetDB( DB_MASTER );
function newFromRedirect( $text ) {
global $wgMwRedir;
$rt = NULL;
- if ( $wgMwRedir->matchStart( $text ) ) {
+ if ( $wgMwRedir->match( $text ) ) {
if ( preg_match( '/\[{2}(.*?)(?:\||\]{2})/', $text, $m ) ) {
# categories are escaped using : for example one can enter:
# #REDIRECT [[:Category:Music]]. Need to remove it.