2004-02-18 02:15:00 +00:00
|
|
|
<?php
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
2012-05-12 20:33:02 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
2008-03-12 17:37:03 +00:00
|
|
|
*
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @file
|
2004-09-02 23:28:24 +00:00
|
|
|
*/
|
2003-08-31 09:46:37 +00:00
|
|
|
|
2022-12-09 12:28:41 +00:00
|
|
|
namespace MediaWiki\Parser;
|
|
|
|
|
|
2024-08-08 09:39:26 +00:00
|
|
|
use MediaWiki\Language\Language;
|
2018-07-24 16:44:09 +00:00
|
|
|
use MediaWiki\MediaWikiServices;
|
2022-12-09 12:28:41 +00:00
|
|
|
use StringUtils;
|
2023-10-20 11:58:05 +00:00
|
|
|
use UnexpectedValueException;
|
2018-07-24 16:44:09 +00:00
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
2012-07-10 12:48:06 +00:00
|
|
|
* This class encapsulates "magic words" such as "#redirect", __NOTOC__, etc.
|
2012-02-01 20:53:38 +00:00
|
|
|
*
|
2023-10-07 01:28:57 +00:00
|
|
|
* See docs/magicword.md.
|
|
|
|
|
*
|
2012-02-01 20:53:38 +00:00
|
|
|
* @par Usage:
|
|
|
|
|
* @code
|
2018-07-24 16:44:09 +00:00
|
|
|
* if ( $magicWordFactory->get( 'redirect' )->match( $text ) ) {
|
2012-02-01 20:53:38 +00:00
|
|
|
* // some code
|
|
|
|
|
* }
|
|
|
|
|
* @endcode
|
2006-01-07 13:09:30 +00:00
|
|
|
*
|
|
|
|
|
* Please avoid reading the data out of one of these objects and then writing
|
2004-09-02 23:28:24 +00:00
|
|
|
* special case code. If possible, add another match()-like function here.
|
2004-09-03 23:00:01 +00:00
|
|
|
*
|
2012-01-18 17:43:08 +00:00
|
|
|
* To add magic words in an extension, use $magicWords in a file listed in
|
|
|
|
|
* $wgExtensionMessagesFiles[].
|
2012-07-10 12:48:06 +00:00
|
|
|
*
|
2012-02-01 20:53:38 +00:00
|
|
|
* @par Example:
|
|
|
|
|
* @code
|
2016-09-12 10:06:37 +00:00
|
|
|
* $magicWords = [];
|
2012-01-18 17:43:08 +00:00
|
|
|
*
|
2016-09-12 10:06:37 +00:00
|
|
|
* $magicWords['en'] = [
|
2017-02-25 21:53:36 +00:00
|
|
|
* 'magicwordkey' => [ 0, 'case_insensitive_magic_word' ],
|
|
|
|
|
* 'magicwordkey2' => [ 1, 'CASE_sensitive_magic_word2' ],
|
2016-09-12 10:06:37 +00:00
|
|
|
* ];
|
2012-02-01 20:53:38 +00:00
|
|
|
* @endcode
|
2012-01-18 17:43:08 +00:00
|
|
|
*
|
2020-06-10 16:28:20 +00:00
|
|
|
* For magic words which name Parser double underscore names, add a
|
|
|
|
|
* GetDoubleUnderscoreIDs hook. Use string keys.
|
|
|
|
|
*
|
|
|
|
|
* For magic words which name Parser magic variables, add a GetMagicVariableIDs
|
2006-07-14 16:36:35 +00:00
|
|
|
* hook. Use string keys.
|
|
|
|
|
*
|
2023-10-07 01:28:57 +00:00
|
|
|
* @since 1.1
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup Parser
|
2004-09-02 23:28:24 +00:00
|
|
|
*/
|
2003-08-31 09:46:37 +00:00
|
|
|
class MagicWord {
|
2014-05-12 14:42:51 +00:00
|
|
|
|
2023-07-25 11:09:42 +00:00
|
|
|
/** @var string|null Potentially null for a short time before {@see load} is called */
|
2014-05-12 14:42:51 +00:00
|
|
|
public $mId;
|
|
|
|
|
|
2017-10-02 11:52:17 +00:00
|
|
|
/** @var string[] */
|
2023-10-06 08:33:00 +00:00
|
|
|
public array $mSynonyms;
|
2014-05-12 14:42:51 +00:00
|
|
|
|
|
|
|
|
/** @var bool */
|
|
|
|
|
public $mCaseSensitive;
|
|
|
|
|
|
2023-10-06 08:55:06 +00:00
|
|
|
private ?string $mBaseRegex = null;
|
2014-05-12 14:42:51 +00:00
|
|
|
|
2023-10-06 08:33:00 +00:00
|
|
|
private Language $contLang;
|
2018-07-26 12:21:31 +00:00
|
|
|
|
2017-10-02 11:52:17 +00:00
|
|
|
/**
|
2023-10-07 01:28:57 +00:00
|
|
|
* @internal Use {@see MagicWordFactory::get} instead
|
|
|
|
|
* @param string|null $id Preload internal name of the magic word
|
|
|
|
|
* @param string[]|string $syn Preload synonyms for the magic word
|
2017-10-02 11:52:17 +00:00
|
|
|
* @param bool $cs If magic word is case sensitive
|
2023-10-06 08:33:00 +00:00
|
|
|
* @param Language|null $contentLanguage
|
2017-10-02 11:52:17 +00:00
|
|
|
*/
|
2024-10-16 18:58:33 +00:00
|
|
|
public function __construct( $id = null, $syn = [], $cs = false, ?Language $contentLanguage = null ) {
|
2003-08-31 09:46:37 +00:00
|
|
|
$this->mId = $id;
|
|
|
|
|
$this->mSynonyms = (array)$syn;
|
|
|
|
|
$this->mCaseSensitive = $cs;
|
2023-10-06 08:33:00 +00:00
|
|
|
$this->contLang = $contentLanguage ?: MediaWikiServices::getInstance()->getContentLanguage();
|
2003-08-31 09:46:37 +00:00
|
|
|
}
|
|
|
|
|
|
2011-05-21 19:55:05 +00:00
|
|
|
/**
|
2023-10-07 01:28:57 +00:00
|
|
|
* Load synonym data from {@see LocalisationCache}.
|
2011-05-21 19:55:05 +00:00
|
|
|
*
|
2023-10-07 01:28:57 +00:00
|
|
|
* @internal For use by {@see MagicWordFactory::get} only
|
|
|
|
|
* @since 1.1
|
2017-10-02 11:52:17 +00:00
|
|
|
* @param string $id
|
2011-05-21 19:55:05 +00:00
|
|
|
*/
|
2023-10-06 08:33:00 +00:00
|
|
|
public function load( $id ): void {
|
2003-08-31 09:46:37 +00:00
|
|
|
$this->mId = $id;
|
2018-07-26 12:21:31 +00:00
|
|
|
$this->contLang->getMagic( $this );
|
2006-10-02 17:04:13 +00:00
|
|
|
if ( !$this->mSynonyms ) {
|
2023-10-20 11:58:05 +00:00
|
|
|
throw new UnexpectedValueException( "Error: invalid magic word '$id'" );
|
2006-10-02 17:04:13 +00:00
|
|
|
}
|
2003-08-31 09:46:37 +00:00
|
|
|
}
|
2006-01-07 13:31:29 +00:00
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
2023-10-07 01:28:57 +00:00
|
|
|
* Create a regex to match the magic word in wikitext
|
2011-05-21 19:55:05 +00:00
|
|
|
*
|
2023-10-07 01:28:57 +00:00
|
|
|
* @since 1.1
|
2011-05-21 19:55:05 +00:00
|
|
|
* @return string
|
2004-09-02 23:28:24 +00:00
|
|
|
*/
|
2023-10-06 08:33:00 +00:00
|
|
|
public function getRegex(): string {
|
2023-10-06 08:55:06 +00:00
|
|
|
return '/' . $this->getBaseRegex() . '/' . $this->getRegexCase();
|
2003-08-31 09:46:37 +00:00
|
|
|
}
|
|
|
|
|
|
2006-01-08 05:35:03 +00:00
|
|
|
/**
|
2023-10-07 01:28:57 +00:00
|
|
|
* Get the regexp case modifier ("iu" or empty string).
|
|
|
|
|
*
|
|
|
|
|
* This is for building custom regexes that include {@see getBaseRegex}.
|
|
|
|
|
* The other getter methods return complete expressions that include this already.
|
2011-05-21 19:55:05 +00:00
|
|
|
*
|
2023-10-07 01:28:57 +00:00
|
|
|
* @internal Exposed for {@see Parser::cleanSig} only
|
2011-05-21 19:55:05 +00:00
|
|
|
* @return string
|
2006-01-08 05:35:03 +00:00
|
|
|
*/
|
2023-10-06 08:33:00 +00:00
|
|
|
public function getRegexCase(): string {
|
2006-10-08 13:00:42 +00:00
|
|
|
return $this->mCaseSensitive ? '' : 'iu';
|
2006-01-08 05:35:03 +00:00
|
|
|
}
|
|
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
2023-10-07 01:28:57 +00:00
|
|
|
* Create a regex to match the word at the start of a line in wikitext
|
2011-05-21 19:55:05 +00:00
|
|
|
*
|
2023-10-07 01:28:57 +00:00
|
|
|
* @since 1.1
|
2011-05-21 19:55:05 +00:00
|
|
|
* @return string
|
2004-09-02 23:28:24 +00:00
|
|
|
*/
|
2023-10-06 08:33:00 +00:00
|
|
|
public function getRegexStart(): string {
|
2023-10-06 08:55:06 +00:00
|
|
|
return '/^(?:' . $this->getBaseRegex() . ')/' . $this->getRegexCase();
|
2003-08-31 09:46:37 +00:00
|
|
|
}
|
2004-01-12 00:55:01 +00:00
|
|
|
|
2013-12-17 18:14:15 +00:00
|
|
|
/**
|
2023-10-07 01:28:57 +00:00
|
|
|
* Create a regex to match the word as the only thing on a line of wikitext
|
2013-12-17 18:14:15 +00:00
|
|
|
*
|
|
|
|
|
* @since 1.23
|
2023-10-07 01:28:57 +00:00
|
|
|
* @return string
|
2013-12-17 18:14:15 +00:00
|
|
|
*/
|
2023-10-06 08:33:00 +00:00
|
|
|
public function getRegexStartToEnd(): string {
|
2023-10-06 08:55:06 +00:00
|
|
|
return '/^(?:' . $this->getBaseRegex() . ')$/' . $this->getRegexCase();
|
2013-12-17 18:14:15 +00:00
|
|
|
}
|
|
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
2023-10-07 01:28:57 +00:00
|
|
|
* Get the middle of {@see getRegex}, without the surrounding slashes or modifiers
|
2011-05-21 19:55:05 +00:00
|
|
|
*
|
2023-10-07 01:28:57 +00:00
|
|
|
* @internal Exposed for {@see Parser::cleanSig} only
|
|
|
|
|
* @since 1.1
|
2011-05-21 19:55:05 +00:00
|
|
|
* @return string
|
2004-09-02 23:28:24 +00:00
|
|
|
*/
|
2023-10-06 08:33:00 +00:00
|
|
|
public function getBaseRegex(): string {
|
2023-10-06 08:55:06 +00:00
|
|
|
if ( $this->mBaseRegex === null ) {
|
|
|
|
|
// Sort the synonyms by length, descending, so that the longest synonym
|
|
|
|
|
// matches in precedence to the shortest
|
|
|
|
|
$synonyms = $this->mSynonyms;
|
|
|
|
|
usort( $synonyms, static fn ( $a, $b ) => strlen( $b ) <=> strlen( $a ) );
|
|
|
|
|
foreach ( $synonyms as &$synonym ) {
|
|
|
|
|
$synonym = preg_quote( $synonym, '/' );
|
|
|
|
|
}
|
|
|
|
|
$this->mBaseRegex = implode( '|', $synonyms );
|
2003-08-31 09:46:37 +00:00
|
|
|
}
|
|
|
|
|
return $this->mBaseRegex;
|
|
|
|
|
}
|
2006-01-07 13:31:29 +00:00
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
2023-10-07 01:28:57 +00:00
|
|
|
* Check if given wikitext contains the magic word
|
2011-05-21 19:55:05 +00:00
|
|
|
*
|
2023-10-07 01:28:57 +00:00
|
|
|
* @since 1.1
|
2014-04-22 11:07:02 +00:00
|
|
|
* @param string $text
|
2010-01-12 07:24:25 +00:00
|
|
|
* @return bool
|
2004-09-02 23:28:24 +00:00
|
|
|
*/
|
2023-10-06 08:33:00 +00:00
|
|
|
public function match( $text ): bool {
|
2010-01-12 07:24:25 +00:00
|
|
|
return (bool)preg_match( $this->getRegex(), $text );
|
2003-08-31 09:46:37 +00:00
|
|
|
}
|
|
|
|
|
|
2013-12-17 18:14:15 +00:00
|
|
|
/**
|
2023-10-07 01:28:57 +00:00
|
|
|
* Check if given wikitext contains the word as the only thing on a line
|
2013-12-17 18:14:15 +00:00
|
|
|
*
|
2014-04-22 11:07:02 +00:00
|
|
|
* @param string $text
|
2013-12-17 18:14:15 +00:00
|
|
|
* @return bool
|
|
|
|
|
* @since 1.23
|
|
|
|
|
*/
|
2023-10-06 08:33:00 +00:00
|
|
|
public function matchStartToEnd( $text ): bool {
|
2013-12-17 18:14:15 +00:00
|
|
|
return (bool)preg_match( $this->getRegexStartToEnd(), $text );
|
|
|
|
|
}
|
|
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
2023-10-07 01:28:57 +00:00
|
|
|
* Remove any matches of this magic word from a given text
|
2011-05-21 19:55:05 +00:00
|
|
|
*
|
2023-10-07 01:28:57 +00:00
|
|
|
* Returns true if the text contains one or more matches, and alters the
|
|
|
|
|
* input string to remove all instances of the magic word.
|
2011-05-21 19:55:05 +00:00
|
|
|
*
|
2023-10-07 01:28:57 +00:00
|
|
|
* @since 1.1
|
|
|
|
|
* @param string &$text
|
2011-05-21 19:55:05 +00:00
|
|
|
* @return bool
|
2004-09-02 23:28:24 +00:00
|
|
|
*/
|
2023-10-06 08:33:00 +00:00
|
|
|
public function matchAndRemove( &$text ): bool {
|
2023-10-04 15:19:14 +00:00
|
|
|
$text = preg_replace( $this->getRegex(), '', $text, -1, $count );
|
|
|
|
|
return (bool)$count;
|
2003-08-31 09:46:37 +00:00
|
|
|
}
|
|
|
|
|
|
2011-05-21 19:55:05 +00:00
|
|
|
/**
|
2017-08-11 00:23:16 +00:00
|
|
|
* @param string &$text
|
2011-05-21 19:55:05 +00:00
|
|
|
* @return bool
|
|
|
|
|
*/
|
2023-10-06 08:33:00 +00:00
|
|
|
public function matchStartAndRemove( &$text ): bool {
|
2023-10-04 15:19:14 +00:00
|
|
|
$text = preg_replace( $this->getRegexStart(), '', $text, -1, $count );
|
|
|
|
|
return (bool)$count;
|
2006-07-14 16:36:35 +00:00
|
|
|
}
|
2004-03-20 15:03:26 +00:00
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
2023-10-07 01:28:57 +00:00
|
|
|
* Replace any matches of this word with something else
|
2011-05-21 19:55:05 +00:00
|
|
|
*
|
2023-10-07 01:28:57 +00:00
|
|
|
* @since 1.1
|
2014-04-22 11:07:02 +00:00
|
|
|
* @param string $replacement
|
|
|
|
|
* @param string $subject
|
|
|
|
|
* @param int $limit
|
2011-05-21 19:55:05 +00:00
|
|
|
* @return string
|
|
|
|
|
*/
|
2016-03-01 10:56:04 +00:00
|
|
|
public function replace( $replacement, $subject, $limit = -1 ) {
|
2014-05-12 14:42:51 +00:00
|
|
|
$res = preg_replace(
|
|
|
|
|
$this->getRegex(),
|
|
|
|
|
StringUtils::escapeRegexReplacement( $replacement ),
|
|
|
|
|
$subject,
|
|
|
|
|
$limit
|
|
|
|
|
);
|
2004-01-07 02:51:47 +00:00
|
|
|
return $res;
|
2003-09-21 13:10:10 +00:00
|
|
|
}
|
|
|
|
|
|
2004-09-02 23:28:24 +00:00
|
|
|
/**
|
2023-10-07 01:28:57 +00:00
|
|
|
* Get one of the synonyms
|
2011-05-21 19:55:05 +00:00
|
|
|
*
|
2024-03-18 09:58:11 +00:00
|
|
|
* This exists primarily for calling `getSynonym( 0 )`, which is how
|
2023-10-07 01:28:57 +00:00
|
|
|
* you can obtain the preferred name of a magic word according to the
|
|
|
|
|
* current wiki's content language. For example, when demonstrating or
|
|
|
|
|
* semi-automatically creating content that uses a given magic word.
|
|
|
|
|
*
|
|
|
|
|
* This works because {@see LocalisationCache} merges magic word data by
|
|
|
|
|
* appending fallback languages (i.e. "en") after to the language's
|
|
|
|
|
* own data, and each language's `Messages*.php` file lists the
|
|
|
|
|
* preferred/canonical form as the first value.
|
|
|
|
|
*
|
|
|
|
|
* Calling this with a number other than 0 is unsupported and may
|
|
|
|
|
* fail.
|
2011-05-21 19:55:05 +00:00
|
|
|
*
|
2023-10-07 01:28:57 +00:00
|
|
|
* @since 1.1
|
|
|
|
|
* @param int $i
|
2011-05-21 19:55:05 +00:00
|
|
|
* @return string
|
2004-09-02 23:28:24 +00:00
|
|
|
*/
|
2016-03-01 10:56:04 +00:00
|
|
|
public function getSynonym( $i ) {
|
2003-09-21 13:10:10 +00:00
|
|
|
return $this->mSynonyms[$i];
|
|
|
|
|
}
|
2004-01-07 02:51:47 +00:00
|
|
|
|
2011-05-21 19:55:05 +00:00
|
|
|
/**
|
2023-10-07 01:28:57 +00:00
|
|
|
* Get full list of synonyms
|
|
|
|
|
*
|
|
|
|
|
* @since 1.7
|
2017-10-02 11:52:17 +00:00
|
|
|
* @return string[]
|
2011-05-21 19:55:05 +00:00
|
|
|
*/
|
2023-10-06 08:33:00 +00:00
|
|
|
public function getSynonyms(): array {
|
2006-07-02 17:47:24 +00:00
|
|
|
return $this->mSynonyms;
|
|
|
|
|
}
|
|
|
|
|
|
2011-05-21 19:55:05 +00:00
|
|
|
/**
|
2023-10-07 01:28:57 +00:00
|
|
|
* @since 1.7
|
2011-05-21 19:55:05 +00:00
|
|
|
* @return bool
|
|
|
|
|
*/
|
2016-03-01 10:56:04 +00:00
|
|
|
public function isCaseSensitive() {
|
2006-07-03 08:57:29 +00:00
|
|
|
return $this->mCaseSensitive;
|
|
|
|
|
}
|
Basic integrated audio/video support, with Ogg implementation.
* JavaScript video player based loosely on Greg Maxwell's player
* Image page text snippet customisation
* Abstraction of transform parameters in the parser. Introduced Linker::makeImageLink2().
* Made canRender(), mustRender() depend on file, not just on handler. Moved width=0, height=0 checking to ImageHandler::canRender(), since audio streams have width=height=0 but should be rendered.
Also:
* Automatic upgrade for oldimage rows on image page view, allows media handler selection based on oi_*_mime
* oi_*_mime unconditionally referenced, REQUIRES SCHEMA UPGRADE
* Don't destroy file info for missing files on upgrade
* Simple, centralised extension message file handling
* Made MessageCache::loadAllMessages non-static, optimised for repeated-call case due to abuse in User.php
* Support for lightweight parser output hooks, with callback whitelist for security
* Moved Linker::formatSize() to Language, to join the new formatTimePeriod() and formatBitrate()
* Introduced MagicWordArray, regex capture trick requires that magic word IDs DO NOT CONTAIN HYPHENS.
2007-08-15 10:50:09 +00:00
|
|
|
|
2011-05-21 19:55:05 +00:00
|
|
|
/**
|
2017-10-02 11:52:17 +00:00
|
|
|
* @return string
|
2023-10-07 01:28:57 +00:00
|
|
|
* @deprecated since 1.42 Internal method should not be used
|
2011-05-21 19:55:05 +00:00
|
|
|
*/
|
2016-03-01 10:56:04 +00:00
|
|
|
public function getId() {
|
2023-10-07 01:28:57 +00:00
|
|
|
wfDeprecated( __METHOD__, '1.42' );
|
Basic integrated audio/video support, with Ogg implementation.
* JavaScript video player based loosely on Greg Maxwell's player
* Image page text snippet customisation
* Abstraction of transform parameters in the parser. Introduced Linker::makeImageLink2().
* Made canRender(), mustRender() depend on file, not just on handler. Moved width=0, height=0 checking to ImageHandler::canRender(), since audio streams have width=height=0 but should be rendered.
Also:
* Automatic upgrade for oldimage rows on image page view, allows media handler selection based on oi_*_mime
* oi_*_mime unconditionally referenced, REQUIRES SCHEMA UPGRADE
* Don't destroy file info for missing files on upgrade
* Simple, centralised extension message file handling
* Made MessageCache::loadAllMessages non-static, optimised for repeated-call case due to abuse in User.php
* Support for lightweight parser output hooks, with callback whitelist for security
* Moved Linker::formatSize() to Language, to join the new formatTimePeriod() and formatBitrate()
* Introduced MagicWordArray, regex capture trick requires that magic word IDs DO NOT CONTAIN HYPHENS.
2007-08-15 10:50:09 +00:00
|
|
|
return $this->mId;
|
|
|
|
|
}
|
2003-08-31 09:46:37 +00:00
|
|
|
}
|
2022-12-09 12:28:41 +00:00
|
|
|
|
2024-03-07 21:56:58 +00:00
|
|
|
/** @deprecated class alias since 1.40 */
|
2022-12-09 12:28:41 +00:00
|
|
|
class_alias( MagicWord::class, 'MagicWord' );
|