Esempio n. 1
0
 /**
  * Decodes the file name and adjusts file parts accordingly
  *
  * @param array $pathParts Path parts of the URLs (can be modified)
  * @return array GET varaibles from the file name or empty array
  */
 protected function decodeSpURL_decodeFileName(array &$pathParts)
 {
     $getVars = array();
     $fileName = array_pop($pathParts);
     $fileParts = $this->apiWrapper->revExplode('.', $fileName, 2);
     if (count($fileParts) == 2 && !$fileParts[1]) {
         $this->decodeSpURL_throw404('File "' . $fileName . '" was not found (2)!');
     }
     list($segment, $extension) = $fileParts;
     if ($extension) {
         $getVars = array();
         if (!$this->decodeSpURL_decodeFileName_lookupInIndex($fileName, $segment, $extension, $pathParts, $getVars)) {
             if (!$this->decodeSpURL_decodeFileName_checkHtmlSuffix($fileName, $segment, $extension, $pathParts)) {
                 $this->decodeSpURL_throw404('File "' . $fileName . '" was not found (1)!');
             }
         }
     } elseif ($fileName != '') {
         $pathParts[] = $fileName;
     }
     return $getVars;
 }