예제 #1
0
파일: Service.php 프로젝트: JudonH/writer
 /**
  * 禁止系统调用的函数
  */
 private static function _init_funtions()
 {
     if (!function_exists('rename_function')) {
         return;
     }
     $funcs = array_merge(App_Info::config('FORBIDDEN_FUNCTIONS'), Core_Utils::$forbidden_funcs);
     foreach ($funcs as $func) {
         if (function_exists($func)) {
             $funcx = Core_Utils::random_name($func);
             rename_function($func, $funcx);
         }
     }
 }
예제 #2
0
 /**
  * header方法
  * @param string $content
  * @param string $replace
  * @param string $http_response_code
  */
 protected function header($content, $replace = true, $http_response_code = false)
 {
     $conx = explode(':', $content, 2);
     if (strtoupper($conx[0]) == 'LOCATION' && isset($conx[1])) {
         $f = Common_Func::url_in_array_host(trim($conx[1]), App_Info::config('HOST_LOCATION_ALLOW'));
         if (!is_null($f) && !$f) {
             $this->error('url跳转非法,可在URL_LOCATION_ALLOW配置');
         }
     }
     $header_func = function_exists('rename_function') ? Core_Utils::random_name('header') : 'header';
     if (is_int($http_response_code)) {
         $header_func($content, $replace, $http_response_code);
     } else {
         $header_func($content, $replace);
     }
 }