Tony Murray 8c639aa5a4 PSR2 Cleanup: /html edition
Travis tests for code conformance. Ignore warnings for now.
Fixed all errors, left most warnings.
2016-08-18 21:29:30 -05:00

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;
}