aboutsummaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/bookmark2tagservice.php3
-rw-r--r--services/tag2tagservice.php3
-rw-r--r--services/tagservice.php2
3 files changed, 8 insertions, 0 deletions
diff --git a/services/bookmark2tagservice.php b/services/bookmark2tagservice.php
index 7085d5f..851884f 100644
--- a/services/bookmark2tagservice.php
+++ b/services/bookmark2tagservice.php
@@ -369,6 +369,7 @@ class Bookmark2TagService {
function renameTag($userid, $old, $new, $fromApi = false) {
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
+ $tagservice =& ServiceFactory::getServiceInstance('TagService');
if (is_null($userid) || is_null($old) || is_null($new))
return false;
@@ -381,6 +382,8 @@ class Bookmark2TagService {
$this->deleteTag($userid, $old);
// Attach new tags
+ $new = $tagservice->normalize($new);
+
foreach(array_keys($bookmarks) as $key) {
$row =& $bookmarks[$key];
$this->attachTags($row['bId'], $new, $fromApi, NULL, false);
diff --git a/services/tag2tagservice.php b/services/tag2tagservice.php
index 4cce66d..a2d7ac3 100644
--- a/services/tag2tagservice.php
+++ b/services/tag2tagservice.php
@@ -270,6 +270,9 @@ class Tag2TagService {
}
function renameTag($uId, $oldName, $newName) {
+ $tagservice =& ServiceFactory::getServiceInstance('TagService');
+ $newName = $tagservice->normalize($newName);
+
$query = 'UPDATE `'. $this->getTableName() .'`';
$query.= ' SET tag1="'.$newName.'"';
$query.= ' WHERE tag1="'.$oldName.'"';
diff --git a/services/tagservice.php b/services/tagservice.php
index ac30061..fba85fa 100644
--- a/services/tagservice.php
+++ b/services/tagservice.php
@@ -68,6 +68,8 @@ class TagService {
}
function renameTag($uId, $oldName, $newName) {
+ $newname = $this->normalize($newname);
+
$query = 'UPDATE `'. $this->getTableName() .'`';
$query.= ' SET tag="'.$newName.'"';
$query.= ' WHERE tag="'.$oldName.'"';