Skip to content

Commit

Permalink
Solved issue winteram#2 ('save' button issue), etc.
Browse files Browse the repository at this point in the history
-'Save' button fixed to work when template name contains space
-Updated delete function to work when template name contains space
  • Loading branch information
nolach committed Mar 17, 2013
1 parent c78fe6b commit ea9e058
Show file tree
Hide file tree
Showing 3 changed files with 1,023 additions and 1,021 deletions.
14 changes: 7 additions & 7 deletions core/fileManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ function writeoutput($output)
}
else {
$errors = "";
// template name is set, has only alphanumeric characters, and is < 30 characters
// template name is set and is < 30 characters
if(!isset($form["template-name"]) ||
strlen($form["template-name"]) > 30 ||
$form["template-name"] != preg_replace('/[^A-Za-z0-9]+/','',$form["template-name"]))
strlen($form["template-name"]) > 30 /*||
$form["template-name"] != preg_replace('/[^A-Za-z0-9]+/','',$form["template-name"])*/)
{
$errors .= "<li class='error-item'>";
$errors .= "Please input a valid template name (less than 30 alphanumeric characters only) ";
$errors .= " </li>";
$errors .= "Please input a valid template name (less than 30 characters)";
$errors .= "</li>";
}
else
{
Expand Down Expand Up @@ -358,10 +358,10 @@ function writeoutput($output)
// else if template name has changed
else if ($_REQUEST['oldname'] != $form["template-name"])
{
// check for template-name conflict happened earlier, so this is safe
// checked for template-name conflict happened earlier, so this is safe
rename("../templates/".$_REQUEST['oldname'],"../templates/".$form["template-name"]);

// check if old name is currently active, if so, change?
// check if old name is currently active, if so, change
// also need to rename in active.txt
$optArr = array('oldName' => $_REQUEST['oldname'],
'newName' => $form['template-name'],
Expand Down
Loading

0 comments on commit ea9e058

Please sign in to comment.