glob rather than readdir, sorts too
This commit is contained in:
		
							parent
							
								
									f12c963ee0
								
							
						
					
					
						commit
						33fbc52862
					
				@ -61,8 +61,7 @@ class BulkAdd extends SimpleExtension {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		$list = "";
 | 
							$list = "";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		$dir = opendir("$base/$subdir");
 | 
							foreach(glob("$base/$subdir/*") as $filename) {
 | 
				
			||||||
		while($filename = readdir($dir)) {
 | 
					 | 
				
			||||||
			$fullpath = "$base/$subdir/$filename";
 | 
								$fullpath = "$base/$subdir/$filename";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if(is_link($fullpath)) {
 | 
								if(is_link($fullpath)) {
 | 
				
			||||||
@ -89,7 +88,6 @@ class BulkAdd extends SimpleExtension {
 | 
				
			|||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		closedir($dir);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if(strlen($list) > 0) {
 | 
							if(strlen($list) > 0) {
 | 
				
			||||||
			$this->theme->add_status("Adding $subdir", $list);
 | 
								$this->theme->add_status("Adding $subdir", $list);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user