// Call parent constructor
parent::__construct($className);
}
+
+ /**
+ * Validates given UNL very basicly by given regular expression. You
+ * normally don't need/want to overwrite this method as this is a very basic
+ * validation only based on a regex.
+ *
+ * @param $unl Universal Node Locator to validate
+ * @param $regex Regular expression to use for validation without slashes
+ * @return $isValid Whether the UNL is valid
+ */
+ protected final function isValidUniversalNodeLocator ($unl, $regex) {
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl . ',regex=' . $regex . ' - CALLED!');
+
+ // Very basic regex check
+ $isValid = (preg_match('/^' . $regex . '$/', $unl) === 1);
+
+ // Return result
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: isValid=' . intval($isValid) . ' - EXIT!');
+ return $isValid;
+ }
}
// [EOF]