Add is_interwiki_link method

This commit is contained in:
Starbeamrainbowlabs 2019-01-05 13:04:52 +00:00
parent 1d14fdc85d
commit 08ff3772b3
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 10 additions and 0 deletions

View File

@ -89,4 +89,14 @@ function interwiki_get_pagename_url($interwiki_pagename) {
);
}
/**
* Returns whether a given pagename is an interwiki link or not.
* Note that this doesn't guarantee that it's a _valid_ interwiki link - only that it looks like one :P
* @param string $pagename The page name to check.
* @return boolean Whether the given page name is an interwiki link or not.
*/
function is_interwiki_link($pagename) {
return strpos($pagename, ":") !== false;
}
?>