Skip to content

LanguageGetMagic hook is deprecated #32

@maidentaiwan

Description

@maidentaiwan

The MediaWiki hook "LanguageGetMagic" is deprecated and should be removed from the EmbedVideo code.

Diffs against version 1.0:

Index: EmbedVideo.i18n.php
===================================================================
--- EmbedVideo.i18n.php (revision 21505)
+++ EmbedVideo.i18n.php (working copy)
@@ -21,3 +21,10 @@
                'embedvideo-bad-id' => 'Ð Ñег EmbedVideo введен невеÑнÑй id "$1" видео Ð´Ð»Ñ ÑеÑвиÑа "$2".',
                'embedvideo-illegal-width' => 'Ð Ñег EmbedVideo введен невеÑнÑй паÑамеÑÑ ÑиÑÐ¸Ð½Ñ "$1".',
 );
+
+
+$magicWords = array();
+$magicWords['en'] = array(
+       'evp' => array(0, 'evp'),
+       'ev' => array(0, 'ev'),
+);
Index: EmbedVideo.php
===================================================================
--- EmbedVideo.php      (revision 21505)
+++ EmbedVideo.php      (working copy)
@@ -36,6 +36,4 @@
                return true;
        }
        $wgHooks['LanguageGetMagic'][] = 'wfEmbedVideoLanguageGetMagic';
-} else {
-       $wgHooks['LanguageGetMagic'][] = 'EmbedVideo::parserFunctionMagic';
 }
Index: EmbedVideo.hooks.php
===================================================================
--- EmbedVideo.hooks.php     (revision 21505)
+++ EmbedVideo.hooks.php     (working copy)
@@ -25,19 +25,6 @@
        }

        /**
-        * Adds magic words for parser functions.
-        * @param array  $magicWords
-        * @param string $langCode
-        *
-        * @return bool Always true
-        */
-       public static function parserFunctionMagic(&$magicWords, $langCode='en') {
-               $magicWords['evp'] = array(0, 'evp');
-               $magicWords['ev']  = array(0, 'ev');
-               return true;
-       }
-
-       /**
         * Embeds video of the chosen service, legacy support for 'evp' version of
         * the tag
         * @param Parser $parser Instance of running Parser.
@@ -66,8 +53,6 @@
                // Initialize things once
                if (!self::$initialized) {
                        self::VerifyWidthMinAndMax();
-                       // Add system messages
-                       wfLoadExtensionMessages('embedvideo');
                        $parser->disableCache();
                        self::$initialized = true;
                }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions