improved script server check
This commit is contained in:
		
							parent
							
								
									6d5185ecc2
								
							
						
					
					
						commit
						d93a4f84cd
					
				| 
						 | 
					@ -746,7 +746,7 @@ class LAMConfig {
 | 
				
			||||||
			 		$ip = $arr_value;
 | 
								 		$ip = $arr_value;
 | 
				
			||||||
					$servername = "";
 | 
										$servername = "";
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				if (isset($ip) && is_string($ip) && preg_match("/^[a-z0-9-]+(\\.[a-z0-9-]+)*$/i", $ip)) {
 | 
									if (isset($ip) && is_string($ip) && preg_match("/^[a-z0-9-]+(\\.[a-z0-9-]+)*(,[0-9]+)?$/i", $ip)) {
 | 
				
			||||||
					// Check if the IP has a server name
 | 
										// Check if the IP has a server name
 | 
				
			||||||
					if (!empty($servername)) {
 | 
										if (!empty($servername)) {
 | 
				
			||||||
						$valid_ips[] = $servername.":".$ip;
 | 
											$valid_ips[] = $servername.":".$ip;
 | 
				
			||||||
| 
						 | 
					@ -755,6 +755,10 @@ class LAMConfig {
 | 
				
			||||||
						$valid_ips[] = $ip;
 | 
											$valid_ips[] = $ip;
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
									else {
 | 
				
			||||||
 | 
										// wrong format
 | 
				
			||||||
 | 
										return false;
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			// Check that the array is not empty
 | 
								// Check that the array is not empty
 | 
				
			||||||
			if ($array_string > 0) {
 | 
								if ($array_string > 0) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue