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") {
|
else if($event->get_arg(0) == "replace") {
|
||||||
global $user;
|
global $user;
|
||||||
if($user->is_admin() && isset($_POST['search']) && isset($_POST['replace'])) {
|
if($user->is_admin() && isset($_POST['search']) && isset($_POST['replace'])) {
|
||||||
|
$search = $_POST['search'];
|
||||||
|
$replace = $_POST['replace'];
|
||||||
global $page;
|
global $page;
|
||||||
$this->mass_tag_edit($_POST['search'], $_POST['replace']);
|
if(strpos($search, " ") === false && strpos($replace, " ") === false) {
|
||||||
$page->set_mode("redirect");
|
$this->mass_tag_edit($search, $replace);
|
||||||
$page->set_redirect(make_link("admin"));
|
$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