/** Make a special page URL of the form [[Special:Somepage/{title_urlform}]] */ function makeSpecialParamUrl($name, $query = '', $param = '{title_urlform}') { // Abuse makeTitle's lax validity checking to slip a control character into the URL $title = Title::makeTitle(NS_SPECIAL, "{$name}/"); $url = cbt_escape($title->getLocalURL($query)); // Now replace it with the parameter return str_replace('%1A', $param, $url); }
/** * Escape text for a template if we are producing a template. Do nothing * if we are producing plain text. */ function templateEscape($text) { if ($this->mCompiling) { return cbt_escape($text); } else { return $text; } }