public static function endReset(&$parser, $text) { if (!self::$createdLinks['resetdone']) { self::$createdLinks['resetdone'] = true; foreach ($parser->mOutput->mCategories as $key => $val) { if (array_key_exists($key, self::$fixedCategories)) { self::$fixedCategories[$key] = $val; } } // $text .= self::dumpParsedRefs($parser,"before final reset"); if (self::$createdLinks['resetLinks']) { $parser->mOutput->mLinks = []; } if (self::$createdLinks['resetCategories']) { $parser->mOutput->mCategories = self::$fixedCategories; } if (self::$createdLinks['resetTemplates']) { $parser->mOutput->mTemplates = []; } if (self::$createdLinks['resetImages']) { $parser->mOutput->mImages = []; } // $text .= self::dumpParsedRefs($parser,"after final reset"); self::$fixedCategories = []; } return true; }