Project

General

Profile

Bug #2010 » globals.patch

Andre Keller, 11/16/2011 01:57 PM

View differences:

/etc/inc/globals.inc 2011-11-16 18:59:50.000000000 +0000
34 34

  
35 35
*/
36 36

  
37
function remove_numbers($string) {
38
	$nums = array("1", "2", "3", "4", "5", "6", "7", "8", "9", "0", " ");
39
	$string = str_replace($nums, '', $string);
40
	return $string;
37
function remove_ifindex($string) {
38
	return preg_replace("/[0-9 ]+$/", "", $string);
41 39
}
42 40

  
43 41
function get_nics_with_capabilities($CAPABILITIES) {
......
48 46
		$iface = trim($iface);
49 47
		$capable = pfSense_get_interface_addresses($iface);
50 48
		if(isset($capable['caps'][$CAPABILITIES])) {
51
			$interfacenonum = remove_numbers($iface);
49
			$interfacenonum = remove_ifindex($iface);
52 50
			if(!in_array($interfacenonum, $vlan_native_supp))
53 51
				$vlan_native_supp[] = $interfacenonum;
54 52
		}
(2-2/3)