/** * Default text of the links to the Title $target * * @param Title $target * * @return string */ private static function linkText($target) { if (!$target instanceof Title) { wfWarn(__METHOD__ . ': Requires $target to be a Title object.'); return ''; } // If the target is just a fragment, with no title, we return the fragment // text. Otherwise, we return the title text itself. if ($target->getPrefixedText() === '' && $target->hasFragment()) { return htmlspecialchars($target->getFragment()); } return htmlspecialchars($target->getPrefixedText()); }
/** * Default text of the links to the Title $target * * @param Title $target * * @return string */ private static function linkText($target) { // We might be passed a non-Title by make*LinkObj(). Fail gracefully. if (!$target instanceof Title) { return ''; } // If the target is just a fragment, with no title, we return the fragment // text. Otherwise, we return the title text itself. if ($target->getPrefixedText() === '' && $target->hasFragment()) { return htmlspecialchars($target->getFragment()); } return htmlspecialchars($target->getPrefixedText()); }