getRequest(); $param = $request->getParam(); if(empty($param['mod'])) $instance = $system->getSiteParam($system->getSiteId(), '', 'startinstance', '-'); else $instance = $param['mod']; $view = empty($param['view']) ? 'index' : $param['view']; if(!preg_match('#^\*{0,1}[a-zA-Z0-9_.-]*$#', $instance)) throw new InvalidArgumentException('Malformated request'); if(!preg_match('#^[a-zA-Z0-9_.-]*$#', $view)) throw new InvalidArgumentException('Malformated request'); if($instance[0] == '*') { // xtra mode $system->setTarget(iSystem::TARGET_INSTANCE, '*'); $system->setTarget(iSystem::TARGET_VIEW, substr($instance, 1)); } else { $system->setTarget(iSystem::TARGET_INSTANCE, $instance); $system->setTarget(iSystem::TARGET_VIEW, $view); } } }