]> 91.132.146.200 Git - bibliotheca-php.git/commitdiff
binary compare for tag management
authorBanana <mail@bananas-playground.net>
Mon, 4 Jan 2021 18:21:46 +0000 (19:21 +0100)
committerBanana <mail@bananas-playground.net>
Mon, 4 Jan 2021 18:21:46 +0000 (19:21 +0100)
webclient/lib/managetags.class.php
webclient/view/default/managetags/managetags.html

index 7e85bd6a7e79391e033f0990ff53cdaad252594c..4daeea7d49920fc8b258505c37f7c93c16136e97 100644 (file)
@@ -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);
index db64dda6ea5b95ff5d904935fc5ad25f95d3ad76..9f702c5d5d0d363f15bb76b410e63060583f2cc2 100644 (file)
@@ -5,7 +5,8 @@
                        The actions are top down. If you choose to move and rename, only move will be executed.<br />
                        Deletion will remove without recover!<br />
                        If you rename and input an existing one a move will be done instead.<br />
-                       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.
                </p>
                <?php if(!empty($TemplateData['tags'])) { ?>