Index: trunk/extensions/ApprovedRevs/ApprovedRevs_body.php |
— | — | @@ -78,18 +78,23 @@ |
79 | 79 | * approvable. Also stores the boolean answer as a field in the page |
80 | 80 | * object, to speed up processing if it's called more than once. |
81 | 81 | */ |
82 | | - public static function pageIsApprovable( $title ) { |
| 82 | + public static function pageIsApprovable( Title $title ) { |
83 | 83 | // if this function was already called for this page, the |
84 | 84 | // value should have been stored as a field in the $title object |
85 | 85 | if ( isset( $title->isApprovable ) ) { |
86 | 86 | return $title->isApprovable; |
87 | 87 | } |
88 | 88 | |
| 89 | + if ( !$title->exists() ) { |
| 90 | + $title->isApprovable = false; |
| 91 | + return $title->isApprovable; |
| 92 | + } |
| 93 | + |
89 | 94 | // check the namespace |
90 | 95 | global $egApprovedRevsNamespaces; |
91 | 96 | if ( in_array( $title->getNamespace(), $egApprovedRevsNamespaces ) ) { |
92 | 97 | $title->isApprovable = true; |
93 | | - return true; |
| 98 | + return $title->isApprovable; |
94 | 99 | } |
95 | 100 | |
96 | 101 | // it's not in an included namespace, so check for the page |