Index: trunk/extensions/QPoll/model/qp_pollstore.php |
— | — | @@ -254,9 +254,9 @@ |
255 | 255 | } |
256 | 256 | |
257 | 257 | /** |
258 | | - * @return mixed Title instance of interpretation template |
| 258 | + * @return mixed Title instance of interpretation template (existing or not) |
259 | 259 | * false, when no interpretation template is defined in poll header |
260 | | - * null, when interpretation template does not exist (error) |
| 260 | + * null, when the title parts are invalid (error) |
261 | 261 | */ |
262 | 262 | function getInterpTitle() { |
263 | 263 | if ( is_null( $this->interpDBkey ) ) { |
— | — | @@ -266,7 +266,7 @@ |
267 | 267 | return false; |
268 | 268 | } |
269 | 269 | $title = Title::newFromText( $this->interpDBkey, $this->interpNS ); |
270 | | - return ( $title instanceof Title ) ? ( $title->exists() ? $title : null ) : null; |
| 270 | + return ( $title instanceof Title ) ? $title : null; |
271 | 271 | } |
272 | 272 | |
273 | 273 | // warning: will work only after successful loadUserAlreadyVoted() or loadUserVote() |
— | — | @@ -889,9 +889,10 @@ |
890 | 890 | $this->interpResult = new qp_InterpResult(); |
891 | 891 | $interpTitle = $this->getInterpTitle(); |
892 | 892 | if ( $interpTitle === false ) { |
| 893 | + # this poll has no interpretation script |
893 | 894 | return; |
894 | 895 | } |
895 | | - if ( $interpTitle === null ) { |
| 896 | + if ( !( $interpTitle instanceof Title ) || !$interpTitle->exists() ) { |
896 | 897 | $this->interpResult->storeErroneous = false; |
897 | 898 | $this->interpResult->setError( wfMsg( 'qp_error_no_interpretation' ) ); |
898 | 899 | return; |
Index: trunk/extensions/QPoll/specials/qp_results.php |
— | — | @@ -182,7 +182,7 @@ |
183 | 183 | array( '__tag' => 'div', 'style' => 'font-weight:bold;', wfMsg( 'qp_results_submit_attempts', intval( $pollStore->attempts ) ) ) |
184 | 184 | ); |
185 | 185 | $interpTitle = $pollStore->getInterpTitle(); |
186 | | - if ( $interpTitle === null ) { |
| 186 | + if ( !( $interpTitle instanceof Title ) ) { |
187 | 187 | $tags[] = wfMsg( 'qp_poll_has_no_interpretation' ); |
188 | 188 | return $tags; |
189 | 189 | } |