Added lower() to some tag lookups

Removed a duplicate include line
This commit is contained in:
Matthew Barbour 2019-10-10 10:12:03 -05:00 committed by Shish
parent f594e9066e
commit aa5c8c81e0
2 changed files with 4 additions and 4 deletions

View file

@ -90,8 +90,8 @@ class DanbooruApi extends Extension
} elseif (isset($_GET['name'])) {
$namelist = explode(",", $_GET['name']);
foreach ($namelist as $name) {
$sqlresult = $database->get_all(
"SELECT id,tag,count FROM tags WHERE tag = ?",
$sqlresult = $database->get_all($database->scoreql_to_sql(
"SELECT id,tag,count FROM tags WHERE SCORE_STRNORM(tag) = SCORE_STRNORM(?)"),
[$name]
);
foreach ($sqlresult as $row) {

View file

@ -55,7 +55,7 @@ class NotATag extends Extension
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
{
global $user;
if ($event->parent==="tags") {
if($event->parent==="tags") {
if ($user->can(Permissions::BAN_IMAGE)) {
$event->add_nav_link("untags", new Link('untag/list/1'), "UnTags");
}
@ -89,7 +89,7 @@ class NotATag extends Extension
$page->set_redirect($_SERVER['HTTP_REFERER']);
} elseif ($event->get_arg(0) == "remove") {
if (isset($_POST['tag'])) {
$database->Execute("DELETE FROM untags WHERE tag = ?", [$_POST['tag']]);
$database->Execute($database->scoreql_to_sql("DELETE FROM untags WHERE SCORE_STRNORM(tag) = SCORE_STRNORM(?)"), [$_POST['tag']]);
flash_message("Image ban removed");
$page->set_mode(PageMode::REDIRECT);