r106442 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106441‎ | r106442 | r106443 >
Date:15:45, 16 December 2011
Author:demon
Status:ok
Tags:
Comment:
Rename make_safe -> makeSafe
Modified paths:
  • /trunk/extensions/FundraiserLandingPage/FundraiserLandingPage.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FundraiserLandingPage/FundraiserLandingPage.body.php
@@ -25,7 +25,7 @@
2626 $output = '';
2727
2828 # begin generating the template call
29 - $template = $this->make_safe( $wgRequest->getText( 'template', $wgFundraiserLPDefaults[ 'template' ] ) );
 29+ $template = $this->makeSafe( $wgRequest->getText( 'template', $wgFundraiserLPDefaults[ 'template' ] ) );
3030 $output .= "{{ $template\n";
3131
3232 # get the required variables (except template and country) to use for the landing page
@@ -36,7 +36,7 @@
3737 'form-countryspecific'
3838 );
3939 foreach( $requiredParams as $requiredParam ) {
40 - $param = $this->make_safe(
 40+ $param = $this->makeSafe(
4141 $wgRequest->getText( $requiredParam, $wgFundraiserLPDefaults[$requiredParam] )
4242 );
4343 // Add them to the template call
@@ -49,7 +49,7 @@
5050 if ( !$country ) {
5151 $country = $wgFundraiserLPDefaults[ 'country' ];
5252 }
53 - $country = $this->make_safe( $country );
 53+ $country = $this->makeSafe( $country );
5454 $output .= "| country = $country\n";
5555
5656 $excludeKeys = $requiredParams + array( 'template', 'country', 'title' );
@@ -61,8 +61,8 @@
6262 continue;
6363 }
6464 # get the variable's name and value
65 - $key = $this->make_safe( $k_unsafe );
66 - $val = $this->make_safe( $v_unsafe );
 65+ $key = $this->makeSafe( $k_unsafe );
 66+ $val = $this->makeSafe( $v_unsafe );
6767 # print to the template in wiki-syntax
6868 $output .= "| $key = $val\n";
6969 }
@@ -82,7 +82,7 @@
8383 * @param $string The unsafe string to escape and check for invalid characters
8484 * @return mixed|String A string matching the regex or an empty string
8585 */
86 - function make_safe( $string ) {
 86+ function makeSafe( $string ) {
8787 $num = preg_match( '([a-zA-Z0-9_-]+)', $string, $matches );
8888
8989 if ( $num == 1 ){

Status & tagging log