From: Banana Date: Mon, 4 Jan 2021 18:21:46 +0000 (+0100) Subject: binary compare for tag management X-Git-Tag: 1.0~5 X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=8f6d32a83430a1dd6f7f937b371b367a69e199ea;p=bibliotheca-php.git binary compare for tag management --- diff --git a/webclient/lib/managetags.class.php b/webclient/lib/managetags.class.php index 7e85bd6..4daeea7 100644 --- a/webclient/lib/managetags.class.php +++ b/webclient/lib/managetags.class.php @@ -93,6 +93,7 @@ class ManageTags { /** * Move in field from to given new string + * Does a BINARY compare in SQL for $from * * @param string $field Field ID to use in lookup table * @param string $from Value string to search for in lookup table @@ -109,7 +110,7 @@ class ManageTags { $queryStr = "UPDATE `".DB_PREFIX."_collection_entry2lookup_".$this->_DB->real_escape_string($this->_collectionId)."` SET `value` = '".$this->_DB->real_escape_string($to)."' WHERE `fk_field` = '".$this->_DB->real_escape_string($field)."' - AND `value` = '".$this->_DB->real_escape_string($from)."'"; + AND `value` = BINARY '".$this->_DB->real_escape_string($from)."'"; if(QUERY_DEBUG) error_log("[QUERY] ".__METHOD__." query: ".var_export($queryStr,true)); try { $this->_DB->query($queryStr); @@ -123,7 +124,8 @@ class ManageTags { } /** - * Delete the given $what for field $field in entry lookup table + * Delete the given $what for field $field in entry lookup table. + * Does a BINARY compare in SQL for $what * * @param string $field Field ID to use in lookup table * @param string $what Value to search for and delete from lookup table @@ -137,7 +139,7 @@ class ManageTags { $queryStr = "DELETE FROM `".DB_PREFIX."_collection_entry2lookup_".$this->_DB->real_escape_string($this->_collectionId)."` WHERE `fk_field` = '".$this->_DB->real_escape_string($field)."' - AND `value` = '".$this->_DB->real_escape_string($what)."'"; + AND `value` = BINARY '".$this->_DB->real_escape_string($what)."'"; if(QUERY_DEBUG) error_log("[QUERY] ".__METHOD__." query: ".var_export($queryStr,true)); try { $this->_DB->query($queryStr); diff --git a/webclient/view/default/managetags/managetags.html b/webclient/view/default/managetags/managetags.html index db64dda..9f702c5 100644 --- a/webclient/view/default/managetags/managetags.html +++ b/webclient/view/default/managetags/managetags.html @@ -5,7 +5,8 @@ The actions are top down. If you choose to move and rename, only move will be executed.
Deletion will remove without recover!
If you rename and input an existing one a move will be done instead.
- Tag values are stored how they come. But treated case insensitive in search. + Tag values are stored how they come and treated that way here (case sensitive). + In search they are case insensitive.