mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-23 15:56:50 +00:00
MWException -> Exception
Change-Id: I816b62c93e4eb08514b122add614f5457d6fad9a
This commit is contained in:
parent
b0678d96dd
commit
ce20b1cef8
|
@ -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;
|
||||
|
|
|
@ -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" );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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