Index: trunk/extensions/ProofreadPage/ProofreadPage.php |
— | — | @@ -63,11 +63,15 @@ |
64 | 64 | function pr_main() { |
65 | 65 | global $wgParser; |
66 | 66 | global $pr_page_namespace, $pr_index_namespace; |
67 | | - $wgParser->setHook( "pagelist", "pr_renderPageList" ); |
68 | | - $wgParser->setHook( "pages", "pr_renderPages" ); |
69 | | - $wgParser->setHook( "pagequality", "pr_pageQuality" ); |
70 | | - $pr_page_namespace = null; |
71 | | - $pr_index_namespace = null; |
| 67 | + |
| 68 | + // @fixme Use ParserFirstCallInit hook, $wgParser is evil |
| 69 | + if ( !is_null( $wgParser ) ) { |
| 70 | + $wgParser->setHook( "pagelist", "pr_renderPageList" ); |
| 71 | + $wgParser->setHook( "pages", "pr_renderPages" ); |
| 72 | + $wgParser->setHook( "pagequality", "pr_pageQuality" ); |
| 73 | + $pr_page_namespace = null; |
| 74 | + $pr_index_namespace = null; |
| 75 | + } |
72 | 76 | } |
73 | 77 | |
74 | 78 | |