r86037 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86036‎ | r86037 | r86038 >
Date:09:52, 14 April 2011
Author:ashley
Status:ok
Tags:
Comment:
CustomUserSignup: swap $_GET to $wgRequest
Modified paths:
  • /trunk/extensions/CustomUserSignup/CustomUserSignup.hooks.php (modified) (history)
  • /trunk/extensions/CustomUserSignup/CustomUserTemplate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CustomUserSignup/CustomUserSignup.hooks.php
@@ -9,8 +9,9 @@
1010 class CustomUserSignupHooks {
1111
1212 public static function userCreateForm( &$template ) {
13 - if( isset( $_GET['campaign'] ) ) {
14 - $campaign = $_GET['campaign'];
 13+ global $wgRequest;
 14+ if( isset( $wgRequest->getVal( 'campaign' ) ) ) {
 15+ $campaign = $wgRequest->getVal( 'campaign' );
1516 $newTemplate;
1617 if( get_class( $template ) == 'UserloginTemplate' ) {
1718 $newTemplate = new CustomUserloginTemplate();
@@ -43,8 +44,9 @@
4445 }
4546
4647 public static function welcomeScreen( &$welcomeCreationMsg, &$injected_html ) {
47 - if( isset( $_GET['campaign'] ) ) {
48 - $campaign = $_GET['campaign'];
 48+ global $wgRequest;
 49+ if( isset( $wgRequest->getVal( 'campaign' ) ) ) {
 50+ $campaign = $wgRequest->getVal( 'campaign' );
4951
5052 if( wfMsg( "customusertemplate-$campaign-welcomecreation" ) != "<customusertemplate-$campaign-welcomecreation>" ) {
5153 $welcomeCreationMsg = "customusertemplate-$campaign-welcomecreation";
Index: trunk/extensions/CustomUserSignup/CustomUserTemplate.php
@@ -5,9 +5,10 @@
66 protected $campaign = null;
77
88 function __construct() {
 9+ global $wgRequest;
910 parent::__construct();
10 - if( isset( $_GET['campaign'] ) ) {
11 - preg_match( '/[A-Za-z0-9]+/', $_GET['campaign'], $matches );
 11+ if( isset( $wgRequest->getVal( 'campaign' ) ) ) {
 12+ preg_match( '/[A-Za-z0-9]+/', $wgRequest->getVal( 'campaign' ), $matches );
1213 $this->campaign = $matches[0];
1314 }
1415 }
@@ -45,9 +46,10 @@
4647 protected $campaign = null;
4748
4849 function __construct() {
 50+ global $wgRequest;
4951 parent::__construct();
50 - if( isset( $_GET['campaign'] ) ) {
51 - preg_match( '/[A-Za-z0-9]+/', $_GET['campaign'], $matches );
 52+ if( isset( $wgRequest->getVal( 'campaign' ) ) ) {
 53+ preg_match( '/[A-Za-z0-9]+/', $wgRequest->getVal( 'campaign' ), $matches );
5254 $this->campaign = $matches[0];
5355 }
5456 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86015Added code for CustomUserSignup, extension to allow custom user signup flowsnimishg23:57, 13 April 2011

Status & tagging log