部分插件跳转时,没带上网站域名,然后浏览器就默认以当前url路径为前缀进行跳转,导致链接错误
打开:source\function\function_core.php
找到
- function dheader($string, $replace = true, $http_response_code = 0) {
- $islocation = substr(strtolower(trim($string)), 0, 8) == 'location';
- if(defined('IN_MOBILE') && strpos($string, 'mobile') === false && $islocation) {
- if (strpos($string, '?') === false) {
- $string = $string.'?mobile='.IN_MOBILE;
- } else {
- if(strpos($string, '#') === false) {
- $string = $string.'&mobile='.IN_MOBILE;
- } else {
- $str_arr = explode('#', $string);
- $str_arr[0] = $str_arr[0].'&mobile='.IN_MOBILE;
- $string = implode('#', $str_arr);
- }
- }
- }
- $string = str_replace(array("\r", "\n"), array('', ''), $string);
- if(empty($http_response_code) || PHP_VERSION < '4.3' ) {
- @header($string, $replace);
- } else {
- @header($string, $replace, $http_response_code);
- }
- if($islocation) {
- exit();
- }
- }
复制代码 修改为- function dheader($string, $replace = true, $http_response_code = 0) {
- global $_G;
- $islocation = substr(strtolower(trim($string)), 0, 8) == 'location';
- if($islocation){
- if(!preg_match('/location:\s*https?:\/\//is', $string)){
- $string = preg_replace("/location:\s*/is", 'Location: '.$_G['siteurl'], $string);
- }
- }
- if(defined('IN_MOBILE') && strpos($string, 'mobile') === false && $islocation) {
- if (strpos($string, '?') === false) {
- $string = $string.'?mobile='.IN_MOBILE;
- } else {
- if(strpos($string, '#') === false) {
- $string = $string.'&mobile='.IN_MOBILE;
- } else {
- $str_arr = explode('#', $string);
- $str_arr[0] = $str_arr[0].'&mobile='.IN_MOBILE;
- $string = implode('#', $str_arr);
- }
- }
- }
- $string = str_replace(array("\r", "\n"), array('', ''), $string);
- if(empty($http_response_code) || PHP_VERSION < '4.3' ) {
- @header($string, $replace);
- } else {
- @header($string, $replace, $http_response_code);
- }
- if($islocation) {
- exit();
- }
- }
复制代码
|