Prevent an internal server error occurring when mincount is less than 1.
This commit is contained in:
		
							parent
							
								
									2b4ffb1e60
								
							
						
					
					
						commit
						6f59de4d45
					
				| @ -281,6 +281,10 @@ class TagList extends Extension { | |||||||
| 
 | 
 | ||||||
| 		$tags_min = $this->get_tags_min(); | 		$tags_min = $this->get_tags_min(); | ||||||
| 		 | 		 | ||||||
|  | 		// Make sure that the value of $tags_min is at least 1.
 | ||||||
|  | 		// Otherwise the database will complain if you try to do: LOG(0)
 | ||||||
|  | 		if ($tags_min < 1){ $tags_min = 1; } | ||||||
|  | 		 | ||||||
| 		// check if we have a cached version
 | 		// check if we have a cached version
 | ||||||
| 		$cache_key = data_path("cache/tag_popul-" . md5("tp" . $tags_min) . ".html"); | 		$cache_key = data_path("cache/tag_popul-" . md5("tp" . $tags_min) . ".html"); | ||||||
| 		if(file_exists($cache_key)) {return file_get_contents($cache_key);} | 		if(file_exists($cache_key)) {return file_get_contents($cache_key);} | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user