Index: trunk/extensions/FundraiserLandingPage/FundraiserLandingPage.body.php |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | $output = ''; |
27 | 27 | |
28 | 28 | # begin generating the template call |
29 | | - $template = $this->make_safe( $wgRequest->getText( 'template', $wgFundraiserLPDefaults[ 'template' ] ) ); |
| 29 | + $template = $this->makeSafe( $wgRequest->getText( 'template', $wgFundraiserLPDefaults[ 'template' ] ) ); |
30 | 30 | $output .= "{{ $template\n"; |
31 | 31 | |
32 | 32 | # get the required variables (except template and country) to use for the landing page |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | 'form-countryspecific' |
38 | 38 | ); |
39 | 39 | foreach( $requiredParams as $requiredParam ) { |
40 | | - $param = $this->make_safe( |
| 40 | + $param = $this->makeSafe( |
41 | 41 | $wgRequest->getText( $requiredParam, $wgFundraiserLPDefaults[$requiredParam] ) |
42 | 42 | ); |
43 | 43 | // Add them to the template call |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | if ( !$country ) { |
51 | 51 | $country = $wgFundraiserLPDefaults[ 'country' ]; |
52 | 52 | } |
53 | | - $country = $this->make_safe( $country ); |
| 53 | + $country = $this->makeSafe( $country ); |
54 | 54 | $output .= "| country = $country\n"; |
55 | 55 | |
56 | 56 | $excludeKeys = $requiredParams + array( 'template', 'country', 'title' ); |
— | — | @@ -61,8 +61,8 @@ |
62 | 62 | continue; |
63 | 63 | } |
64 | 64 | # 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 ); |
67 | 67 | # print to the template in wiki-syntax |
68 | 68 | $output .= "| $key = $val\n"; |
69 | 69 | } |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | * @param $string The unsafe string to escape and check for invalid characters |
84 | 84 | * @return mixed|String A string matching the regex or an empty string |
85 | 85 | */ |
86 | | - function make_safe( $string ) { |
| 86 | + function makeSafe( $string ) { |
87 | 87 | $num = preg_match( '([a-zA-Z0-9_-]+)', $string, $matches ); |
88 | 88 | |
89 | 89 | if ( $num == 1 ){ |