Permalink
Browse files

With the removal of the requirement of a .txt file, you could hit any…

… url without the app returning a 404.

This is now fixed.
  • Loading branch information...
1 parent a93e4a9 commit 126e3152307610d51f565ed83d1f3700424b896e @kolber committed Oct 10, 2009
Showing with 7 additions and 0 deletions.
  1. +7 −0 app/stacey.inc.php
View
7 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

0 comments on commit 126e315

Please sign in to comment.