}
// }}}
+ // {{{ isValidUrlName()
+ /**
+ * check the short url nam eto make sure it doesn't match any file names in the root
+ *
+ * @param mixed $url requested short url name
+ *
+ * @access public
+ * @return string
+ */
+ public function isValidUrlName($url)
+ {
+ if (is_dir(BASE)) {
+ if (file_exists(BASE . $url)) {
+ return false;
+ }
+ if (file_exists(BASE . $url.'.php')) {
+ return false;
+ }
+ if (file_exists(BASE . $url.'.css')) {
+ return false;
+ }
+ if (file_exists(BASE . $url.'.html')) {
+ return false;
+ }
+ if (file_exists(BASE . $url.'.js')) {
+ return false;
+ }
+ return true;
+ } else {
+ throw new Exception('Main Web root dir define BASE not set');
+ }
+ }
+ // }}}
}
?>