Index: trunk/extensions/Commentbox/Commentbox.php |
— | — | @@ -33,17 +33,18 @@ |
34 | 34 | $wgHooks['OutputPageBeforeHTML'][] = 'wfExtensionCommentbox_Add'; |
35 | 35 | |
36 | 36 | function wfExtensionCommentbox_Add( &$op, &$text ) { |
37 | | - global $wgUser, $wgArticle, $wgRequest, $action, $wgTitle, |
| 37 | + global $wgUser, $wgRequest, $action, |
38 | 38 | $wgCommentboxNamespaces, $wgCommentboxRows, |
39 | 39 | $wgCommentboxColumns; |
40 | 40 | |
41 | | - if ( !$wgTitle->exists() ) |
| 41 | + $title = $op->getTitle(); |
| 42 | + if ( !$title->exists() ) |
42 | 43 | return true; |
43 | 44 | |
44 | | - if ( !$wgTitle->userCan( 'edit', true ) ) |
| 45 | + if ( !$title->userCan( 'edit', true ) ) |
45 | 46 | return true; |
46 | | - if ( !array_key_exists( $wgTitle->getNamespace(), $wgCommentboxNamespaces ) |
47 | | - || !$wgCommentboxNamespaces[ $wgTitle->getNamespace() ] ) |
| 47 | + if ( !array_key_exists( $title->getNamespace(), $wgCommentboxNamespaces ) |
| 48 | + || !$wgCommentboxNamespaces[ $title->getNamespace() ] ) |
48 | 49 | return true; |
49 | 50 | if ( !( $action == 'view' || $action == 'purge' || $action == 'submit' ) ) |
50 | 51 | return true; |
— | — | @@ -67,7 +68,7 @@ |
68 | 69 | } |
69 | 70 | $inhalt = wfMsgNoTrans( 'commentbox-prefill' ); |
70 | 71 | $save = wfMsgExt( 'commentbox-savebutton', 'escapenoentities' ); |
71 | | - $texttitle = htmlspecialchars( Title::makeName( $wgTitle->getNamespace(), $wgTitle->getText() ) ); |
| 72 | + $texttitle = htmlspecialchars( Title::makeName( $title->getNamespace(), $title->getText() ) ); |
72 | 73 | |
73 | 74 | $intro = wfMsgExt( 'commentbox-intro', 'parse' ); |
74 | 75 | |