r95833 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95832‎ | r95833 | r95834 >
Date:04:49, 31 August 2011
Author:wikinaut
Status:deferred (Comments)
Tags:
Comment:
added preg_quote() in the the OpenID server module as suggested in code review comment; server module code tested (=ok); fixes cr-fixme and reset to cr-new
Modified paths:
  • /trunk/extensions/OpenID/OpenID.php (modified) (history)
  • /trunk/extensions/OpenID/SpecialOpenIDServer.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenID/SpecialOpenIDServer.body.php
@@ -741,9 +741,13 @@
742742
743743 /* remove "Special:OpenIDXRDS/" to allow construction of a valid user page name */
744744 $specialPagePrefix = SpecialPage::getTitleFor( 'OpenIDXRDS' );
745 - if ( $specialPagePrefix != "Special:OpenIDXRDS" ) $specialPagePrefix = "({$specialPagePrefix}|Special:OpenIDXRDS)";
746 - $relative = preg_replace( "!" . $specialPagePrefix . "/!", "", $relative );
747745
 746+ if ( $specialPagePrefix != "Special:OpenIDXRDS" ) {
 747+ $specialPagePrefix = "( {$specialPagePrefix} | Special:OpenIDXRDS )";
 748+ }
 749+
 750+ $relative = preg_replace( "!" . preg_quote( $specialPagePrefix, "!" ) . "/!", "", $relative );
 751+
748752 # Can't have a pound-sign in the relative, since that's for fragments
749753 if ( !preg_match( "#$pattern#", $relative, $matches ) ) {
750754 return null;
Index: trunk/extensions/OpenID/OpenID.php
@@ -27,7 +27,7 @@
2828 exit( 1 );
2929 }
3030
31 -define( 'MEDIAWIKI_OPENID_VERSION', '0.935-beta 20110830' );
 31+define( 'MEDIAWIKI_OPENID_VERSION', '0.936-beta 20110831' );
3232
3333 $path = dirname( __FILE__ );
3434 set_include_path( implode( PATH_SEPARATOR, array( $path ) ) . PATH_SEPARATOR . get_include_path() );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r88172also treating localised Special:OpenIDXRDS pagenamewikinaut13:06, 15 May 2011

Comments

#Comment by Wikinaut (talk | contribs)   09:40, 31 August 2011

this fixes the issue as mentioned in the r88172 code review comment

Status & tagging log