X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ftitle%2FTitleParser.php;h=0ce5ece015ac203c0fc5c1c238db2a8f580161f2;hb=c503f129c3ed66f5d4865386bc0e26d11fa99a3c;hp=ddffed678911aaeba820d55f580935c9481d15a9;hpb=c1ed1adc038a15d9b6a2fce5cb8f257b1cb204f6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/title/TitleParser.php b/includes/title/TitleParser.php index ddffed6789..0ce5ece015 100644 --- a/includes/title/TitleParser.php +++ b/includes/title/TitleParser.php @@ -32,8 +32,7 @@ */ interface TitleParser { /** - * Parses the given text and constructs a TitleValue. Normalization - * is applied according to the rules appropriate for the form specified by $form. + * Parses the given text and constructs a TitleValue. * * @note this only parses local page links, interwiki-prefixes etc. are not considered! * @@ -44,4 +43,16 @@ interface TitleParser { * @return TitleValue */ public function parseTitle( $text, $defaultNamespace = NS_MAIN ); + + /** + * Given a namespace and title, return a TitleValue if valid, or null if invalid. + * + * @param int $namespace + * @param string $text + * @param string $fragment + * @param string $interwiki + * + * @return TitleValue|null + */ + public function makeTitleValueSafe( $namespace, $text, $fragment = '', $interwiki = '' ); }