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"; } }