'auth', 'ca' => 'cache', 'co' => 'content', 'la' => 'layout', 'mi' => 'misc', 'ro' => 'route', 'se' => 'session' ); $system = System::getInstance(); $request = $system->getRequest(); $param = $request->getParam(); if (empty($param['cat'])) $param['cat'] = 'co.mcms.mmpiadmincontent:welcome'; $action = empty($param['action']) ? '' : $param['action']; if (empty($action)) $action = 'index'; list($plugin,$part) = explode(':',$param['cat'],2); list($cat,$plugin) = explode('.', $plugin,2); if (isset($mapping[$cat])) $cat = $mapping[$cat]; // list of allowed categories if (!in_array($cat, $mapping)) $cat = ''; if (!preg_match('#^[a-zA-Z0-9]*$#',$cat)) throw new InvalidArgumentException('Malformated request (category): '.$cat); if (!preg_match('#^[a-zA-Z0-9.]*$#',$plugin)) throw new InvalidArgumentException('Malformated request (plugin): '.$plugin); if (!preg_match('#^[a-zA-Z0-9]*$#',$part)) throw new InvalidArgumentException('Malformated request (part): '.$part); if (!preg_match('#^[a-zA-Z0-9]*$#',$action)) throw new InvalidArgumentException('Malformated request (action): '.$action); $system->setTarget('cat',$cat); $system->setTarget('plugin',$plugin); $system->setTarget('part',$part); $system->setTarget('action',$action); } }