Last modified: 2010-05-15 15:38:05 UTC
Halló! a) generate [[foo REDIRECT]] with some content b) generate [[bar REDIRECT]] withe the following content #REDIRECT [[foo REDIRECT] one closing braket only; this generates a functional redirect see http://jadesukka.homelinux.org:8180/mediawiki15c/index.php?title=Bar_REDIRECT&redirect=no But it will NOT show up in http://jadesukka.homelinux.org:8180/mediawiki15c/index.php?title=Toiminnot:Whatlinkshere&target=Foo_REDIRECT Regards Reinhardt
Fixed in REL1_4 and HEAd, it was an invalid regular expression in includes/Title.php that accepted redirects with the syntax #REDIRECT [[foo], the old regular expression was \\[\\[([^\\]\\|]+)[\\]\\|] and the new one is \[{2}(.*?)(?:\||\]{2})
(In reply to comment #1) > \[{2}(.*?)(?:\||\]{2}) Won't that match unclosed piped links like "#redirect [[foo|" and "#redirect [[foo|bar"? I think what you want is: \[{2}(.*?)(?:\|.*?)?\]{2} (with a non-capturing group to eat the optional "|bar" but a compulsory "]]" at the end)
> (In reply to comment #2) > > \[{2}(.*?)(?:\||\]{2}) > > Won't that match unclosed piped links like "#redirect [[foo|" and "#redirect > [[foo|bar"? Confirmed: see http://en.wikipedia.org/w/index.php?title=User:IMSoP/sandbox, which contains "#REDIRECT [[User:IMSoP/Gangleri|Foo" (and http://en.wikipedia.org/wiki/Special:Whatlinkshere/User:IMSoP/Gangleri which fails to list this non-link, as you'd expect). This bug is most definitely not fixed, ladies and gentlemen. I've long thought redirect detection should be integrated into Parser.php somehow, where it could just use the existing logic for discovering a link; at least then it would be *consistent* (and cf bug 2333).
Created attachment 4717 [details] regex fix Bug was still alive. (see http://fr.wikipedia.org/w/index.php?title=Utilisateur:NicDumZ/Test_2&redirect=no) Included IMSoP's patch which is appropriate.
Created attachment 4718 [details] regex fix (typo) Fixing a typo in the proposed patch.
Fixed in r31996.