Index: trunk/extensions/Collection/Collection.hooks.php |
— | — | @@ -159,7 +159,7 @@ |
160 | 160 | // the "subpage" (i.e. "par") part has been stripped off by SpecialPage.php |
161 | 161 | // in $wgTitle. |
162 | 162 | $origTitle = Title::newFromText($wgRequest->getVal('title')); |
163 | | - if( !is_null( $origTitle ) |
| 163 | + if( $origTitle |
164 | 164 | && $origTitle->getLocalUrl() == SkinTemplate::makeSpecialUrl( 'Book' ) ) { |
165 | 165 | return; |
166 | 166 | } |
Index: trunk/extensions/Collection/Collection.body.php |
— | — | @@ -55,9 +55,11 @@ |
56 | 56 | self::limitExceeded(); |
57 | 57 | return; |
58 | 58 | } |
59 | | - $title_url = $wgRequest->getVal( 'arttitle', '' ); |
60 | 59 | $oldid = $wgRequest->getInt( 'oldid', 0 ); |
61 | | - $title = Title::newFromText( $title_url ); |
| 60 | + $title = Title::newFromText( $wgRequest->getVal( 'arttitle', '' ) ); |
| 61 | + if ( !$title ) { |
| 62 | + return; |
| 63 | + } |
62 | 64 | $this->addArticle( $title, $oldid ); |
63 | 65 | if ( $oldid == 0 ) { |
64 | 66 | $redirectURL = $title->getFullURL(); |
— | — | @@ -68,9 +70,11 @@ |
69 | 71 | $wgOut->redirect( $redirectURL ); |
70 | 72 | return; |
71 | 73 | case 'remove_article/': |
72 | | - $title_url = $wgRequest->getVal( 'arttitle', '' ); |
73 | 74 | $oldid = $wgRequest->getInt( 'oldid', 0 ); |
74 | | - $title = Title::newFromText( $title_url ); |
| 75 | + $title = Title::newFromText( $wgRequest->getVal( 'arttitle', '' ) ); |
| 76 | + if ( !$title ) { |
| 77 | + return; |
| 78 | + } |
75 | 79 | self::removeArticle( $title, $oldid ); |
76 | 80 | if ( $oldid == 0 ) { |
77 | 81 | $redirectURL = $title->getFullURL(); |
— | — | @@ -87,7 +91,7 @@ |
88 | 92 | $redirectURL = SkinTemplate::makeSpecialUrl( 'Book' ); |
89 | 93 | if ( !empty( $redirect ) ) { |
90 | 94 | $title = Title::newFromText( $redirect ); |
91 | | - if ( !is_null( $title ) ) { |
| 95 | + if ( $title ) { |
92 | 96 | $redirectURL = $title->getFullURL(); |
93 | 97 | } |
94 | 98 | } |
— | — | @@ -125,6 +129,9 @@ |
126 | 130 | return; |
127 | 131 | case 'load_collection/': |
128 | 132 | $title = Title::newFromText( $wgRequest->getVal( 'colltitle', '' ) ); |
| 133 | + if ( !$title ) { |
| 134 | + return; |
| 135 | + } |
129 | 136 | if ( $wgRequest->getVal( 'cancel' ) ) { |
130 | 137 | $wgOut->redirect( $title->getFullURL() ); |
131 | 138 | return; |
— | — | @@ -144,6 +151,9 @@ |
145 | 152 | return; |
146 | 153 | case 'order_collection/': |
147 | 154 | $title = Title::newFromText( $wgRequest->getVal( 'colltitle', '' ) ); |
| 155 | + if ( !$title ) { |
| 156 | + return; |
| 157 | + } |
148 | 158 | $collection = $this->loadCollection( $title ); |
149 | 159 | $partner = $wgRequest->getVal( 'partner', 'pediapress' ); |
150 | 160 | return $this->postZIP( $collection, $partner ); |
— | — | @@ -172,7 +182,7 @@ |
173 | 183 | wfMsgForContent( 'coll-collections' ) . '/' . $collname |
174 | 184 | ); |
175 | 185 | } |
176 | | - if ( !isset( $title ) ) { |
| 186 | + if ( !$title ) { |
177 | 187 | return; |
178 | 188 | } |
179 | 189 | if ( $this->saveCollection( $title, $wgRequest->getBool( 'overwrite' ) ) ) { |
— | — | @@ -200,10 +210,16 @@ |
201 | 211 | return $this->download(); |
202 | 212 | case 'render_article/': |
203 | 213 | $title = Title::newFromText( $wgRequest->getVal( 'arttitle', '' ) ); |
| 214 | + if ( !$title ) { |
| 215 | + return; |
| 216 | + } |
204 | 217 | $oldid = $wgRequest->getInt( 'oldid', 0 ); |
205 | 218 | return $this->renderArticle( $title, $oldid, $wgRequest->getVal( 'writer', 'rl' ) ); |
206 | 219 | case 'render_collection/': |
207 | 220 | $title = Title::newFromText( $wgRequest->getVal( 'colltitle', '' )); |
| 221 | + if ( !$title ) { |
| 222 | + return; |
| 223 | + } |
208 | 224 | $collection = $this->loadCollection( $title ); |
209 | 225 | if ( $collection ) { |
210 | 226 | $this->renderCollection( $collection, $title, $wgRequest->getVal( 'writer', 'rl' ) ); |
— | — | @@ -501,7 +517,7 @@ |
502 | 518 | |
503 | 519 | |
504 | 520 | $articleTitle = Title::newFromText( $articleTitle ); |
505 | | - if( is_null( $articleTitle ) ) { |
| 521 | + if( !$articleTitle ) { |
506 | 522 | continue; |
507 | 523 | } |
508 | 524 | if ($oldid < 0) { |