From 08ff3772b374f380f0035c63bc12504d2f3a2bb5 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sat, 5 Jan 2019 13:04:52 +0000 Subject: [PATCH] Add is_interwiki_link method --- modules/feature-interwiki-links.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/feature-interwiki-links.php b/modules/feature-interwiki-links.php index 93dad01..7469494 100644 --- a/modules/feature-interwiki-links.php +++ b/modules/feature-interwiki-links.php @@ -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; +} + ?>