From cec93d8a4d30147ba7de177122139d942e9be54d Mon Sep 17 00:00:00 2001 From: shish Date: Fri, 6 Jul 2007 04:47:01 +0000 Subject: [PATCH] actually, they are different -- array_add checks for uniqueness git-svn-id: file:///home/shish/svn/shimmie2/trunk@232 7f39781d-f577-437e-ae19-be835c7a54ca --- core/util.inc.php | 6 ++++++ ext/tag_list/theme.php | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/util.inc.php b/core/util.inc.php index 14fdbc8f..3e434b62 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -283,6 +283,12 @@ function array_remove($array, $to_remove) { return $a2; } +function array_add($array, $element) { + $array[] = $element; + $array = array_unique($array); + return $array; +} + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\ * Event API * diff --git a/ext/tag_list/theme.php b/ext/tag_list/theme.php index fd2d5226..3439f16d 100644 --- a/ext/tag_list/theme.php +++ b/ext/tag_list/theme.php @@ -136,7 +136,7 @@ class TagListTheme extends Themelet { } else { $tags = array_remove($tags, "-$tag"); - $tags = array_push($tags, $tag); + $tags = array_add($tags, $tag); return "A"; } } @@ -147,7 +147,7 @@ class TagListTheme extends Themelet { } else { $tags = array_remove($tags, $tag); - $tags = array_push($tags, "-$tag"); + $tags = array_add($tags, "-$tag"); return "S"; } }