mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	Travis tests for code conformance. Ignore warnings for now. Fixed all errors, left most warnings.
		
			
				
	
	
		
			43 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
foreach ($_GET as $key => $get_var) {
 | 
						|
    if (strstr($key, 'opt')) {
 | 
						|
        list($name, $value) = explode('|', $get_var);
 | 
						|
        if (!isset($value)) {
 | 
						|
            $value = 'yes';
 | 
						|
        }
 | 
						|
 | 
						|
        $vars[$name] = $value;
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
$base_url = parse_url($config["base_url"]);
 | 
						|
// don't parse the subdirectory, if there is one in the path
 | 
						|
if (strlen($base_url["path"]) > 1) {
 | 
						|
    $segments = explode('/', trim(str_replace($base_url["path"], "", $_SERVER['REQUEST_URI']), '/'));
 | 
						|
} else {
 | 
						|
    $segments = explode('/', trim($_SERVER['REQUEST_URI'], '/'));
 | 
						|
}
 | 
						|
 | 
						|
foreach ($segments as $pos => $segment) {
 | 
						|
    $segment = urldecode($segment);
 | 
						|
    if ($pos == '0') {
 | 
						|
        $vars['page'] = $segment;
 | 
						|
    } else {
 | 
						|
        list($name, $value) = explode('=', $segment);
 | 
						|
        if ($value == '' || !isset($value)) {
 | 
						|
            $vars[$name] = 'yes';
 | 
						|
        } else {
 | 
						|
            $vars[$name] = $value;
 | 
						|
        }
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
foreach ($_GET as $name => $value) {
 | 
						|
    $vars[$name] = $value;
 | 
						|
}
 | 
						|
 | 
						|
foreach ($_POST as $name => $value) {
 | 
						|
    $vars[$name] = $value;
 | 
						|
}
 |