r87902 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87901‎ | r87902 | r87903 >
Date:09:49, 12 May 2011
Author:faurethomas
Status:ok
Tags:
Comment:
Removes duplicate categories
Modified paths:
  • /trunk/extensions/Categorize/Categorize.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Categorize/Categorize.hooks.php
@@ -40,7 +40,7 @@
4141
4242 #ADD EXISTING CATEGORIES TO INPUT BOX
4343 $arrExistingCats = array();
44 - $arrExistingCats = $m_pageCats;
 44+ $arrExistingCats = array_unique($m_pageCats);
4545 #ADD JAVASCRIPT - use document.write so it is not presented if javascript is disabled.
4646 $m_pageObj->$m_place .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"$wgScriptPath/extensions/Categorize/Categorize.css\" />
4747 \n"; # provisoire
@@ -109,8 +109,7 @@
110110 #CHECK IF USER HAS SELECTED ANY CATEGORIES
111111 if(strlen($strSelectedCats)>1){
112112 $arrSelectedCats = array();
113 - $arrSelectedCats = explode(";",$_POST['txtSelectedCategories2']);
114 - # !!!!!!!!!!!!!!!! TODO dédoublonner les catégories ICI !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 113+ $arrSelectedCats = array_unique(explode(";",$_POST['txtSelectedCategories2']));
115114 foreach( $arrSelectedCats as $m_cat ) {
116115 if(strlen($m_cat)>0){
117116 $m_text .= "\n[[$m_catString:" . mysql_escape_string(trim($m_cat)) . "]]";

Status & tagging log