From ce20b1cef8644a858fba754e2c6e2a3a3e99d66a Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Fri, 9 Jan 2015 17:48:35 -0800 Subject: [PATCH] MWException -> Exception Change-Id: I816b62c93e4eb08514b122add614f5457d6fad9a --- CaptchaStore.php | 4 ++-- ConfirmEdit.alias.php | 2 +- FancyCaptcha.class.php | 6 +++--- MathCaptcha.class.php | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CaptchaStore.php b/CaptchaStore.php index a54db97f8..b0854df1f 100644 --- a/CaptchaStore.php +++ b/CaptchaStore.php @@ -36,7 +36,7 @@ abstract class CaptchaStore { /** * Get somewhere to store captcha data that will persist between requests * - * @throws MWException + * @throws Exception * @return CaptchaStore */ public final static function get() { @@ -45,7 +45,7 @@ abstract class CaptchaStore { if ( in_array( 'CaptchaStore', class_parents( $wgCaptchaStorageClass ) ) ) { self::$instance = new $wgCaptchaStorageClass; } else { - throw new MWException( "Invalid CaptchaStore class $wgCaptchaStorageClass" ); + throw new Exception( "Invalid CaptchaStore class $wgCaptchaStorageClass" ); } } return self::$instance; diff --git a/ConfirmEdit.alias.php b/ConfirmEdit.alias.php index 7a85cd9c0..aa6049a2e 100644 --- a/ConfirmEdit.alias.php +++ b/ConfirmEdit.alias.php @@ -122,4 +122,4 @@ $specialPageAliases['zh-hans'] = array( /** Traditional Chinese (中文(繁體)‎) */ $specialPageAliases['zh-hant'] = array( 'Captcha' => array( '驗證碼' ), -); \ No newline at end of file +); diff --git a/FancyCaptcha.class.php b/FancyCaptcha.class.php index 46387c9e2..95dbaaac4 100644 --- a/FancyCaptcha.class.php +++ b/FancyCaptcha.class.php @@ -159,7 +159,7 @@ class FancyCaptcha extends SimpleCaptcha { function getCaptchaIndex() { $info = $this->pickImage(); if ( !$info ) { - throw new MWException( "Ran out of captcha images" ); + throw new Exception( "Ran out of captcha images" ); } // Generate a random key for use of this captcha image in this session. @@ -363,13 +363,13 @@ class FancyCaptcha extends SimpleCaptcha { /** * @param $basename string * @return Array (salt, hash) - * @throws MWException + * @throws Exception */ public function hashFromImageName( $basename ) { if ( preg_match( '/^image_([0-9a-f]+)_([0-9a-f]+)\\.png$/', $basename, $matches ) ) { return array( $matches[1], $matches[2] ); } else { - throw new MWException( "Invalid filename '$basename'.\n" ); + throw new Exception( "Invalid filename '$basename'.\n" ); } } diff --git a/MathCaptcha.class.php b/MathCaptcha.class.php index ac220baa8..d3e4af69c 100644 --- a/MathCaptcha.class.php +++ b/MathCaptcha.class.php @@ -42,7 +42,7 @@ class MathCaptcha extends SimpleCaptcha { if ( class_exists( 'MathRenderer' ) ) { $math = MathRenderer::getRenderer( $sum, array(), MW_MATH_PNG ); } else { - throw new MWException( 'MathCaptcha requires the Math extension for MediaWiki versions 1.18 and above.' ); + throw new Exception( 'MathCaptcha requires the Math extension for MediaWiki versions 1.18 and above.' ); } $html = $math->render(); return preg_replace( '/alt=".*?"/', '', $html );