Пример #1
0
 private function _get_script_url()
 {
     if (!isset($this->b['PHP_SELF'])) {
         $scriptName = basename($_SERVER['SCRIPT_FILENAME']);
         if (basename($_SERVER['SCRIPT_NAME']) === $scriptName) {
             $this->b['PHP_SELF'] = $_SERVER['SCRIPT_NAME'];
         } else {
             if (basename($_SERVER['PHP_SELF']) === $scriptName) {
                 $this->b['PHP_SELF'] = $_SERVER['PHP_SELF'];
             } else {
                 if (isset($_SERVER['ORIG_SCRIPT_NAME']) && basename($_SERVER['ORIG_SCRIPT_NAME']) === $scriptName) {
                     $this->b['PHP_SELF'] = $_SERVER['ORIG_SCRIPT_NAME'];
                 } else {
                     if (($pos = strpos($_SERVER['PHP_SELF'], '/' . $scriptName)) !== false) {
                         $this->b['PHP_SELF'] = substr($_SERVER['SCRIPT_NAME'], 0, $pos) . '/' . $scriptName;
                     } else {
                         if (isset($_SERVER['DOCUMENT_ROOT']) && strpos($_SERVER['SCRIPT_FILENAME'], $_SERVER['DOCUMENT_ROOT']) === 0) {
                             $this->b['PHP_SELF'] = str_replace('\\', '/', str_replace($_SERVER['DOCUMENT_ROOT'], '', $_SERVER['SCRIPT_FILENAME']));
                             $this->b['PHP_SELF'][0] != '/' && ($this->b['PHP_SELF'] = '/' . $this->b['PHP_SELF']);
                         } else {
                             jam_error::system_error('request_tainting');
                         }
                     }
                 }
             }
         }
     }
     return $this->b['PHP_SELF'];
 }
Пример #2
0
 function _error($message, $tplname)
 {
     jam_error::system_error($message, $tplname);
     exit;
 }