let's fix 2.0 while we're at it...

git-svn-id: file:///home/shish/svn/shimmie2/branches/branch_2.0@873 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2008-05-20 03:15:29 +00:00
parent 9898df3e11
commit b03869c59d
2 changed files with 17 additions and 4 deletions

View File

@ -172,7 +172,7 @@ class Database {
$tags = array_map(array($this, 'resolve_alias'), $tags);
$tags = array_map(array($this, 'sanitise'), $tags);
$tags = array_unique($tags); // remove any duplicate tags
$tags = array_iunique($tags); // remove any duplicate tags
// delete old
$this->delete_tags_from_image($image_id);

View File

@ -87,7 +87,6 @@ function get_memory_limit() {
return $memory;
}
function bbcode2html($text) {
$text = trim($text);
$text = html_escape($text);
@ -124,8 +123,22 @@ function tag_explode($tags) {
return $tag_array;
}
// case insensetive uniqueness
function array_iunique($array) {
$ok = array();
foreach($array as $element) {
$found = false;
foreach($ok as $existing) {
if(strtolower($element) == strtolower($existing)) {
$found = true; break;
}
}
if(!$found) {
$ok[] = $element;
}
}
return $ok;
}
# $db is the connection object