mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-24 00:04:15 +00:00
Merge "MWException -> Exception"
This commit is contained in:
commit
3710af668b
|
@ -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;
|
||||
|
|
|
@ -122,4 +122,4 @@ $specialPageAliases['zh-hans'] = array(
|
|||
/** Traditional Chinese (中文(繁體)) */
|
||||
$specialPageAliases['zh-hant'] = array(
|
||||
'Captcha' => array( '驗證碼' ),
|
||||
);
|
||||
);
|
||||
|
|
|
@ -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" );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue