diff --git a/app/stacey.inc.php b/app/stacey.inc.php index c4bb0c17..83e150de 100755 --- a/app/stacey.inc.php +++ b/app/stacey.inc.php @@ -138,6 +138,7 @@ function __construct($get) { function is_category($name) { // find folder name from $name + $dir = ''; $folders = Helpers::list_files('../content', '/^\d+?\.[^\.]+$/'); foreach($folders as $folder) { if(preg_match('/'.$name.'$/', $folder)) { @@ -302,6 +303,8 @@ function get_images($dir) { } function get_template_file() { + // check folder exists, if not, return 404 + if(!$this->name_unclean) return false; // find the name of the text file preg_match('/\/([^\/]+?)\.txt/', $this->content_file, $template_name); // if template exists, return it @@ -343,6 +346,8 @@ function __construct($name) { } function get_template_file() { + // check folder exists, if not, return 404 + if(!$this->name_unclean) return false; // find the name of the text file preg_match('/\/([^\/]+?)\.txt/', $this->content_file, $template_name); // if template exists, return it @@ -419,6 +424,8 @@ function get_content_file() { } function get_template_file() { + // check folder exists, if not, return 404 + if(!$this->name_unclean) return false; // find the name of the text file preg_match('/\/([^\/]+?)\.txt/', $this->content_file, $template_name); // if template exists, return it