Index: trunk/extensions/Babel/BabelAutoCreate.class.php |
— | — | @@ -39,7 +39,6 @@ |
40 | 40 | } else { |
41 | 41 | $text = wfMsgForContent( 'babel-autocreate-text-levels', $level, $language, $code ); |
42 | 42 | } |
43 | | - $article = new Article( $title, 0 ); |
44 | 43 | |
45 | 44 | $user = self::user(); |
46 | 45 | # Do not add a message if the username is invalid or if the account that adds it, is blocked |
— | — | @@ -48,6 +47,11 @@ |
49 | 48 | } |
50 | 49 | |
51 | 50 | |
| 51 | + $article = new Article( $title, 0 ); |
| 52 | + if( !$article->getTitle()->quickUserCan( 'create', $user ) ) { |
| 53 | + return; # The Babel AutoCreate account is not allowed to create the page |
| 54 | + } |
| 55 | + |
52 | 56 | /* $article->doEdit will call $wgParser->parse. |
53 | 57 | * Calling Parser::parse recursively is baaaadd... (bug 29245) |
54 | 58 | * @todo FIXME: surely there is a better way? |
— | — | @@ -56,7 +60,6 @@ |
57 | 61 | $oldParser = $wgParser; |
58 | 62 | $parserClass = $wgParserConf['class']; |
59 | 63 | $wgParser = new $parserClass( $wgParserConf ); |
60 | | - |
61 | 64 | $article->doEdit( |
62 | 65 | $text, |
63 | 66 | wfMsgForContent( 'babel-autocreate-reason', wfMsgForContent( 'babel-url' ) ), |