Add LinkTarget::hasFragment() helper function
[lhc/web/wiklou.git] / includes / title / TitleValue.php
index c8ebc2a..18a06ea 100644 (file)
@@ -95,6 +95,14 @@ class TitleValue implements LinkTarget {
                return $this->fragment;
        }
 
+       /**
+        * @since 1.27
+        * @return bool
+        */
+       public function hasFragment() {
+               return $this->fragment !== '';
+       }
+
        /**
         * Returns the title's DB key, as supplied to the constructor,
         * without namespace prefix or fragment.