Merge "MWException -> Exception"

This commit is contained in:
jenkins-bot 2015-01-23 21:03:34 +00:00 committed by Gerrit Code Review
commit 3710af668b
4 changed files with 7 additions and 7 deletions

View file

@ -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;

View file

@ -122,4 +122,4 @@ $specialPageAliases['zh-hans'] = array(
/** Traditional Chinese (中文(繁體)‎) */
$specialPageAliases['zh-hant'] = array(
'Captcha' => array( '驗證碼' ),
);
);

View file

@ -166,7 +166,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.
@ -370,13 +370,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" );
}
}

View file

@ -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 );