Index: trunk/extensions/CreateBox/CreateBox.php |
— | — | @@ -53,8 +53,9 @@ |
54 | 54 | |
55 | 55 | function actionCreate( $action, $article ) { |
56 | 56 | wfLoadExtensionMessages( 'CreateBox' ); |
57 | | - if( $action != 'create' ) |
| 57 | + if( $action != 'create' ) { |
58 | 58 | return true; |
| 59 | + } |
59 | 60 | |
60 | 61 | global $wgRequest; |
61 | 62 | $prefix = $wgRequest->getVal( 'prefix' ); |
— | — | @@ -65,10 +66,11 @@ |
66 | 67 | global $wgTitle; |
67 | 68 | $wgTitle = SpecialPage::getTitleFor( 'Badtitle' ); |
68 | 69 | throw new ErrorPageError( 'badtitle', 'badtitletext' ); |
69 | | - } elseif( $title->getArticleID() == 0 ) |
| 70 | + } elseif( $title->getArticleID() == 0 ) { |
70 | 71 | acRedirect( $title, 'edit' ); |
71 | | - else |
| 72 | + } else { |
72 | 73 | acRedirect( $title, 'create' ); |
| 74 | + } |
73 | 75 | } elseif( $wgRequest->getVal( 'section' ) == 'new' || $article->getID() == 0 ) { |
74 | 76 | acRedirect( $article->getTitle(), 'edit' ); |
75 | 77 | } else { |
— | — | @@ -83,10 +85,11 @@ |
84 | 86 | |
85 | 87 | function acGetOption( $input, $name, $value = null ) { |
86 | 88 | if( preg_match( "/^\s*$name\s*=\s*(.*)/mi", $input, $matches ) ) { |
87 | | - if( is_int( $value ) ) |
| 89 | + if( is_int( $value ) ) { |
88 | 90 | return intval( $matches[1] ); |
89 | | - else |
| 91 | + } else { |
90 | 92 | return htmlspecialchars( $matches[1] ); |
| 93 | + } |
91 | 94 | } |
92 | 95 | return $value; |
93 | 96 | } |
— | — | @@ -99,8 +102,9 @@ |
100 | 103 | $preload = $wgRequest->getVal( 'preload' ); |
101 | 104 | $editintro = $wgRequest->getVal( 'editintro' ); |
102 | 105 | $text = $parser->getTitle()->getPrefixedText(); |
103 | | - if( $prefix && strpos( $text, $prefix ) === 0 ) |
| 106 | + if( $prefix && strpos( $text, $prefix ) === 0 ) { |
104 | 107 | $text = substr( $text, strlen( $prefix ) ); |
| 108 | + } |
105 | 109 | } else { |
106 | 110 | $prefix = acGetOption( $input, 'prefix' ); |
107 | 111 | $preload = acGetOption( $input, 'preload' ); |