Exemplo n.º 1
0
 /**
  * Parsing the URI
  *
  * @author Fernando Ontiveros Lira <*****@*****.**>
  * @access public
  * @param string $urlLink
  * @return string
  */
 public static function parseURI($uri, $isRestRequest = false)
 {
     // *** process the $_POST with magic_quotes enabled
     // The magic_quotes_gpc feature has been DEPRECATED as of PHP 5.3.0.
     if (get_magic_quotes_gpc() === 1) {
         $_POST = g::strip_slashes($_POST);
     }
     $aRequestUri = explode('/', $uri);
     if ($isRestRequest) {
         $args = self::parseRestUri($aRequestUri);
     } else {
         $args = self::parseNormalUri($aRequestUri);
     }
     define("SYS_LANG", $args['SYS_LANG']);
     define('SYS_SKIN', $args['SYS_SKIN']);
     define('SYS_COLLECTION', $args['SYS_COLLECTION']);
     define('SYS_TARGET', $args['SYS_TARGET']);
     if ($args['SYS_COLLECTION'] == 'js2') {
         print "ERROR";
         die;
     }
 }
Exemplo n.º 2
0
 /**
  * Parsing the URI
  *
  * @author Fernando Ontiveros Lira <*****@*****.**>
  * @access public
  * @param string $urlLink
  * @return string
  */
 public static function parseURI($uri)
 {
     // *** process the $_POST with magic_quotes enabled
     // The magic_quotes_gpc feature has been DEPRECATED as of PHP 5.3.0.
     if (get_magic_quotes_gpc() === 1) {
         $_POST = g::strip_slashes($_POST);
     }
     $aRequestUri = explode('/', $uri);
     $args = self::parseNormalUri($aRequestUri);
     if (!empty($args)) {
         define("SYS_LANG", $args['SYS_LANG']);
         define('SYS_SKIN', $args['SYS_SKIN']);
         define('SYS_COLLECTION', $args['SYS_COLLECTION']);
         define('SYS_TARGET', $args['SYS_TARGET']);
         if (array_key_exists('API_VERSION', $args)) {
             define('API_VERSION', $args['API_VERSION']);
         }
     }
     if ($args['SYS_COLLECTION'] == 'js2') {
         print "ERROR";
         die;
     }
 }