2.2 merge
git-svn-id: file:///home/shish/svn/shimmie2/branches/branch_2.2@871 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
		
							parent
							
								
									642a3d02e1
								
							
						
					
					
						commit
						96509995a8
					
				@ -338,7 +338,7 @@ class Database {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		$tags = array_map(array($this, 'resolve_alias'), $tags);
 | 
							$tags = array_map(array($this, 'resolve_alias'), $tags);
 | 
				
			||||||
		$tags = array_map(array($this, 'sanitise'), $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
 | 
							// delete old
 | 
				
			||||||
		$this->delete_tags_from_image($image_id);
 | 
							$this->delete_tags_from_image($image_id);
 | 
				
			||||||
 | 
				
			|||||||
@ -343,6 +343,23 @@ function array_contains($array, $target) {
 | 
				
			|||||||
	return false;
 | 
						return false;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 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;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// from http://uk.php.net/network
 | 
					// from http://uk.php.net/network
 | 
				
			||||||
function ip_in_range($IP, $CIDR) {
 | 
					function ip_in_range($IP, $CIDR) {
 | 
				
			||||||
	list ($net, $mask) = split ("/", $CIDR);
 | 
						list ($net, $mask) = split ("/", $CIDR);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user