input validation for bulk tag replace (no spaces)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@594 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
2d88fb75c2
commit
bd69bd88b9
1 changed files with 11 additions and 3 deletions
|
@ -25,10 +25,18 @@ class TagEdit extends Extension {
|
|||
else if($event->get_arg(0) == "replace") {
|
||||
global $user;
|
||||
if($user->is_admin() && isset($_POST['search']) && isset($_POST['replace'])) {
|
||||
$search = $_POST['search'];
|
||||
$replace = $_POST['replace'];
|
||||
global $page;
|
||||
$this->mass_tag_edit($_POST['search'], $_POST['replace']);
|
||||
$page->set_mode("redirect");
|
||||
$page->set_redirect(make_link("admin"));
|
||||
if(strpos($search, " ") === false && strpos($replace, " ") === false) {
|
||||
$this->mass_tag_edit($search, $replace);
|
||||
$page->set_mode("redirect");
|
||||
$page->set_redirect(make_link("admin"));
|
||||
}
|
||||
else {
|
||||
$this->theme->display_error($page, "Search & Replace Error",
|
||||
"Bulk replace can only do single tags -- don't use spaces!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue