From 1a365e77dfb8825136626202b1df462731b42060 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 16 Aug 2015 08:22:05 +0200 Subject: Update to MediaWiki 1.25.2 --- extensions/ConfirmEdit/ApiFancyCaptchaReload.php | 46 - .../FancyCaptcha/ApiFancyCaptchaReload.php | 46 + extensions/ConfirmEdit/FancyCaptcha/extension.json | 4 +- extensions/ConfirmEdit/ReCaptcha/extension.json | 2 +- .../ConfirmEdit/includes/ConfirmEditHooks.php | 27 +- .../geshi/contrib/aliased.php | 122 --- .../SyntaxHighlight_GeSHi/geshi/contrib/cssgen.php | 464 -------- .../geshi/contrib/cssgen2.php | 59 - .../geshi/contrib/example.php | 217 ---- .../geshi/contrib/langcheck.php | 778 ------------- .../geshi/contrib/langwiz.php | 1153 -------------------- 11 files changed, 74 insertions(+), 2844 deletions(-) delete mode 100644 extensions/ConfirmEdit/ApiFancyCaptchaReload.php create mode 100644 extensions/ConfirmEdit/FancyCaptcha/ApiFancyCaptchaReload.php delete mode 100644 extensions/SyntaxHighlight_GeSHi/geshi/contrib/aliased.php delete mode 100644 extensions/SyntaxHighlight_GeSHi/geshi/contrib/cssgen.php delete mode 100644 extensions/SyntaxHighlight_GeSHi/geshi/contrib/cssgen2.php delete mode 100644 extensions/SyntaxHighlight_GeSHi/geshi/contrib/example.php delete mode 100644 extensions/SyntaxHighlight_GeSHi/geshi/contrib/langcheck.php delete mode 100644 extensions/SyntaxHighlight_GeSHi/geshi/contrib/langwiz.php (limited to 'extensions') diff --git a/extensions/ConfirmEdit/ApiFancyCaptchaReload.php b/extensions/ConfirmEdit/ApiFancyCaptchaReload.php deleted file mode 100644 index 8cd28631..00000000 --- a/extensions/ConfirmEdit/ApiFancyCaptchaReload.php +++ /dev/null @@ -1,46 +0,0 @@ -getCaptchaIndex(); - - $result = $this->getResult(); - $result->addValue( null, $this->getModuleName(), array ( 'index' => $captchaIndex ) ); - return true; - } - - /** - * @deprecated since MediaWiki core 1.25 - */ - public function getDescription() { - return 'Get a new FancyCaptcha.'; - } - - public function getAllowedParams() { - return array(); - } - - /** - * @deprecated since MediaWiki core 1.25 - */ - public function getExamples() { - return array( 'api.php?action=fancycaptchareload&format=xml' ); - } - - /** - * @see ApiBase::getExamplesMessages() - */ - protected function getExamplesMessages() { - return array( - 'action=fancycaptchareload' - => 'apihelp-fancycaptchareload-example-1', - ); - } -} diff --git a/extensions/ConfirmEdit/FancyCaptcha/ApiFancyCaptchaReload.php b/extensions/ConfirmEdit/FancyCaptcha/ApiFancyCaptchaReload.php new file mode 100644 index 00000000..8cd28631 --- /dev/null +++ b/extensions/ConfirmEdit/FancyCaptcha/ApiFancyCaptchaReload.php @@ -0,0 +1,46 @@ +getCaptchaIndex(); + + $result = $this->getResult(); + $result->addValue( null, $this->getModuleName(), array ( 'index' => $captchaIndex ) ); + return true; + } + + /** + * @deprecated since MediaWiki core 1.25 + */ + public function getDescription() { + return 'Get a new FancyCaptcha.'; + } + + public function getAllowedParams() { + return array(); + } + + /** + * @deprecated since MediaWiki core 1.25 + */ + public function getExamples() { + return array( 'api.php?action=fancycaptchareload&format=xml' ); + } + + /** + * @see ApiBase::getExamplesMessages() + */ + protected function getExamplesMessages() { + return array( + 'action=fancycaptchareload' + => 'apihelp-fancycaptchareload-example-1', + ); + } +} diff --git a/extensions/ConfirmEdit/FancyCaptcha/extension.json b/extensions/ConfirmEdit/FancyCaptcha/extension.json index 11b877be..dba07d9b 100644 --- a/extensions/ConfirmEdit/FancyCaptcha/extension.json +++ b/extensions/ConfirmEdit/FancyCaptcha/extension.json @@ -38,9 +38,7 @@ "localBasePath": "resources", "remoteExtPath": "ConfirmEdit/FancyCaptcha/resources" }, - "callback": [ - "ConfirmEditHooks::onFancyCaptchaSetup" - ], + "callback": "ConfirmEditHooks::onFancyCaptchaSetup", "config": { "CaptchaClass": "FancyCaptcha", "CaptchaFileBackend": "", diff --git a/extensions/ConfirmEdit/ReCaptcha/extension.json b/extensions/ConfirmEdit/ReCaptcha/extension.json index 5f97810a..79c90491 100644 --- a/extensions/ConfirmEdit/ReCaptcha/extension.json +++ b/extensions/ConfirmEdit/ReCaptcha/extension.json @@ -1,7 +1,7 @@ { "name": "ReCaptcha", "ExtensionFunctions": [ - "efReCaptcha" + "ConfirmEditHooks::efReCaptcha" ], "MessagesDirs": { "ReCaptcha": [ diff --git a/extensions/ConfirmEdit/includes/ConfirmEditHooks.php b/extensions/ConfirmEdit/includes/ConfirmEditHooks.php index 5f9c3384..41c990f1 100644 --- a/extensions/ConfirmEdit/includes/ConfirmEditHooks.php +++ b/extensions/ConfirmEdit/includes/ConfirmEditHooks.php @@ -139,11 +139,36 @@ class ConfirmEditHooks { $wgCaptchaDirectory = "$wgUploadDirectory/captcha"; } } + /** * Callback for extension.json of ReCaptcha to require the recaptcha library php file. * FIXME: This should be done in a better way, e.g. only load the libraray, if really needed. */ public static function onReCaptchaSetup() { - require_once( "ReCaptcha/recaptchalib.php" ); + require_once( __DIR__ . '/../ReCaptcha/recaptchalib.php' ); + } + + /** + * Extension function, moved from ReCaptcha.php when that was decimated. + * Make sure the keys are defined. + */ + public static function efReCaptcha() { + global $wgReCaptchaPublicKey, $wgReCaptchaPrivateKey; + global $recaptcha_public_key, $recaptcha_private_key; + global $wgServerName; + + // Backwards compatibility + if ( $wgReCaptchaPublicKey == '' ) { + $wgReCaptchaPublicKey = $recaptcha_public_key; + } + if ( $wgReCaptchaPrivateKey == '' ) { + $wgReCaptchaPrivateKey = $recaptcha_private_key; + } + + if ( $wgReCaptchaPublicKey == '' || $wgReCaptchaPrivateKey == '' ) { + die ( 'You need to set $wgReCaptchaPrivateKey and $wgReCaptchaPublicKey in LocalSettings.php to ' . + "use the reCAPTCHA plugin. You can sign up for a key here." ); + } } } diff --git a/extensions/SyntaxHighlight_GeSHi/geshi/contrib/aliased.php b/extensions/SyntaxHighlight_GeSHi/geshi/contrib/aliased.php deleted file mode 100644 index 0d4b2838..00000000 --- a/extensions/SyntaxHighlight_GeSHi/geshi/contrib/aliased.php +++ /dev/null @@ -1,122 +0,0 @@ - - * @version $Id$ - */ - -// Your config here -define("SOURCE_ROOT", "/var/www/your/source/root/"); - -// Assume you've put geshi in the include_path already -require_once("geshi.php"); - -// Get path info -$path = SOURCE_ROOT.$_SERVER['PATH_INFO']; - -// Check for dickheads trying to use '../' to get to sensitive areas -$base_path_len = strlen(SOURCE_ROOT); -$real_path = realpath($path); -if(strncmp($real_path, SOURCE_ROOT, $base_path_len)) { - exit("Access outside acceptable path."); -} - -// Check file exists -if(!file_exists($path)) { - exit("File not found ($path)."); -} - -// Prepare GeSHi instance -$geshi = new GeSHi(); -$geshi->set_language('text'); -$geshi->load_from_file($path); -$geshi->set_header_type(GESHI_HEADER_PRE); -$geshi->enable_classes(); -$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 10); -$geshi->set_overall_style('color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;', true); -$geshi->set_line_style('font: normal normal 95% \'Courier New\', Courier, monospace; color: #003030;', 'font-weight: bold; color: #006060;', true); -$geshi->set_code_style('color: #000020;', 'color: #000020;'); -$geshi->set_link_styles(GESHI_LINK, 'color: #000060;'); -$geshi->set_link_styles(GESHI_HOVER, 'background-color: #f0f000;'); -$geshi->set_header_content('Source code viewer - ' . $path . ' - ' . $geshi->get_language_name()); -$geshi->set_header_content_style('font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;'); -$geshi->set_footer_content('Parsed in