$subPage: the subpage string or null if no subpage was specified
'SpecialPageBeforeExecute': Called before SpecialPage::execute.
+Return false to prevent execution.
$special: the SpecialPage object
$subPage: the subpage string or null if no subpage was specified
final public function run( $subPage ) {
/**
* Gets called before @see SpecialPage::execute.
+ * Return false to prevent calling execute() (since 1.27+).
*
* @since 1.20
*
* @param SpecialPage $this
* @param string|null $subPage
*/
- Hooks::run( 'SpecialPageBeforeExecute', [ $this, $subPage ] );
+ if ( !Hooks::run( 'SpecialPageBeforeExecute', [ $this, $subPage ] ) ) {
+ return;
+ }
- $this->beforeExecute( $subPage );
+ if ( $this->beforeExecute( $subPage ) === false ) {
+ return;
+ }
$this->execute( $subPage );
$this->afterExecute( $subPage );
/**
* Gets called before @see SpecialPage::execute.
+ * Return false to prevent calling execute() (since 1.27+).
*
* @since 1.20
*
* @param string|null $subPage
+ * @return bool|void
*/
protected function beforeExecute( $subPage ) {
// No-op