Merge in v0.2.2 fixes

git-svn-id: file:///svn-source/pmgr/branches/v0.3_work@966 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2010-03-12 04:05:00 +00:00
parent 68e6dc2d20
commit 07461f4419
5 changed files with 51 additions and 9 deletions

View File

@@ -32,15 +32,22 @@
*
*/
function sandbox() {
$r = Router::requestRoute();
return !empty($r[3]['sand_route']);
function _box($type) {
static $box = array('type' => null, 'test' => array());
if (!isset($box['type']) && !isset($box['test'][$type])) {
$r = Router::requestRoute();
/* if (!preg_match("/gridData/", $_SERVER['REQUEST_URI'])) { */
/* print("<PRE>Route:\n");print_r($r);print("\n</PRE>\n"); */
/* } */
$box['test'][$type] = !empty($r[3]["${type}_route"]);
if ($box['test'][$type])
$box['type'] = $type;
}
return $box['type'] == $type;
}
function devbox() {
$r = Router::requestRoute();
return !empty($r[3]['dev_route']);
}
function sandbox() { return _box('sand'); }
function devbox() { return _box('dev'); }
function server_request_var($var) {
if (preg_match("/^HTTP_ACCEPT|REMOTE_PORT/", $var))