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:
		
							parent
							
								
									9898df3e11
								
							
						
					
					
						commit
						b03869c59d
					
				| @ -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); | ||||
|  | ||||
| @ -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
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user