Merge "Revert "Limit searches at 500 per page""
[lhc/web/wiklou.git] / includes / parser / ParserOutput.php
index 2950227..c021bea 100644 (file)
@@ -59,8 +59,8 @@ class ParserOutput extends CacheTime {
        const EDITSECTION_REGEX = '#<(?:mw:)?editsection page="(.*?)" section="(.*?)"(?:/>|>(.*?)(</(?:mw:)?editsection>))#';
 
        function __construct( $text = '', $languageLinks = array(), $categoryLinks = array(),
-               $containsOldMagic = false, $titletext = '' )
-       {
+               $containsOldMagic = false, $titletext = ''
+       {
                $this->mText = $text;
                $this->mLanguageLinks = $languageLinks;
                $this->mCategories = $categoryLinks;
@@ -279,10 +279,10 @@ class ParserOutput extends CacheTime {
         * @throws MWException if given invalid input
         */
        function addInterwikiLink( $title ) {
-               $prefix = $title->getInterwiki();
-               if ( $prefix == '' ) {
+               if ( !$title->isExternal() ) {
                        throw new MWException( 'Non-interwiki link passed, internal parser error.' );
                }
+               $prefix = $title->getInterwiki();
                if ( !isset( $this->mInterwikiLinks[$prefix] ) ) {
                        $this->mInterwikiLinks[$prefix] = array();
                }
@@ -453,10 +453,15 @@ class ParserOutput extends CacheTime {
        }
 
        /**
-        * Callback passed by the Parser to the ParserOptions to keep track of which options are used.
-        * @access private
+        * Tags a parser option for use in the cache key for this parser output.
+        * Registered as a watcher at ParserOptions::registerWatcher() by Parser::clearState().
+        *
+        * @see ParserCache::getKey
+        * @see ParserCache::save
+        * @see ParserOptions::addExtraKey
+        * @see ParserOptions::optionsHash
         */
-       function recordOption( $option ) {
+       public function recordOption( $option ) {
                $this->mAccessedOptions[$option] = true;
        }