ECSHOP搜索產品url網址search.php地址很長處理方法

ecshop,在搜索產品時候出現的地址很長,比如 search.php? encode = YTo0OntzOjg6ImNhdGVnb3J5

IjtzOjE6IjAiO3M6ODoia2V5d29yZHMiO3M6MToiZCI7czoxMDoiaW1hZ2VGaWVsZCI7czowOiIiO3M6MTg6InNlYXJjaF9lbmNvZGVfdGltZ 代碼後綴直

 大家使用ecshop,在搜索產品時候出現的地址很長,比如 

  1. search.php?encode=YTo0OntzOjg6ImNhdGVnb3J5IjtzOjE6IjAiO3M6ODoia2V5d29yZHMiO3M6MToiZCI7czoxMDoiaW1hZ2VGaWVsZCI7czowOiIiO3M6MTg6InNlYXJjaF9lbmNvZGVfdGltZ 

代碼後綴直接encode,base64加密了。 如何讓他正常顯示不加密呢? 提供解決方法:

1. 找到search.php,註銷掉18-66行

 

  1. if (empty($_GET['encode'])) 
  2.     $string = array_merge($_GET, $_POST); 
  3.     if (get_magic_quotes_gpc()) 
  4.     { 
  5.         require(dirname(__FILE__) . '/includes/lib_base.php'); 
  6.         //require(dirname(__FILE__) . '/includes/lib_common.php'); 
  7.  
  8.         $string = stripslashes_deep($string); 
  9.     } 
  10.     $string['search_encode_time'] = time(); 
  11.     $string = str_replace('+', '+', base64_encode(serialize($string))); 
  12.  
  13.     header("Location: search.php?encode=$string\n"); 
  14.  
  15.     exit; 
  16. else 
  17.     $string = base64_decode(trim($_GET['encode'])); 
  18.     if ($string !== false) 
  19.     { 
  20.         $string = unserialize($string); 
  21.         if ($string !== false) 
  22.         { 
  23.              
  24.             if (!empty($string['search_encode_time'])) 
  25.             { 
  26.                 if (time() > $string['search_encode_time'] + 2) 
  27.                 { 
  28.                     define('INGORE_VISIT_STATS', true); 
  29.                 } 
  30.             } 
  31.             else 
  32.             { 
  33.                 define('INGORE_VISIT_STATS', true); 
  34.             } 
  35.         } 
  36.         else 
  37.         { 
  38.             $string = array(); 
  39.         } 
  40.     } 
  41.     else 
  42.     { 
  43.         $string = array(); 
  44.     } 

 2.繼續註釋掉69行。

 

$_REQUEST array_merge($_REQUEST, addslashes_deep($string)); 

發佈了22 篇原創文章 · 獲贊 5 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章