男的舔女的下面视频在线播放-少妇愉情理仑片高潮日本-久久久久久国产一区二区三区-麻豆精品一区二区综合-国产精品超碰在线观看-网红极品女神精品视频在线-国产亚洲综合777-高清性视频一区二区播放-中文字幕第一页亚洲天堂

Discuz! 官方交流社區(qū)

標(biāo)題: 搜索錯(cuò)誤問題 [打印本頁]

作者: celover    時(shí)間: 2022-2-10 18:38
標(biāo)題: 搜索錯(cuò)誤問題
用戶不登陸搜索,顯示
Discuz! System Error您當(dāng)前的訪問請(qǐng)求當(dāng)中含有非法字符,已經(jīng)被系統(tǒng)拒絕
PHP Debug
  • [Line: 0022]search.php(discuz_application->init)
  • [Line: 0072]source/class/discuz/discuz_application.php(discuz_application->_init_misc)
  • [Line: 0596]source/class/discuz/discuz_application.php(discuz_application->_xss_check)
  • [Line: 0372]source/class/discuz/discuz_application.php(system_error)
  • [Line: 0023]source/function/function_core.php(discuz_error::system_error)
  • [Line: 0024]source/class/discuz/discuz_error.php(discuz_error::debug_backtrace)


用戶登錄后搜索沒有問題,采用默認(rèn)模板搜索再用戶不登陸的時(shí)候也沒有問題。

將模板目錄下的pubsearchform.php文件刪除,用戶不登陸搜索也沒有問題。

問題就出在pubsearchform.php這個(gè)文件了,對(duì)比了默認(rèn)模板中的pubsearchform.html文件,發(fā)現(xiàn)代碼基本上相同,只是少了下面這段代碼。
  1.    <td class="scbar_icon_td"></td>
  2.                                 <td class="scbar_txt_td"><input type="text" name="srchtxt" id="scbar_txt" value="{lang enter_content}" autocomplete="off" x-webkit-speech speech /></td>
  3.                                 <td class="scbar_type_td"><a href="javascript:;" id="scbar_type" class="xg1" onclick="showMenu(this.id)" hidefocus="true">{lang search}</a></td>
  4.                                 <td class="scbar_btn_td"><button type="submit" name="searchsubmit" id="scbar_btn" sc="1" class="pn pnc" value="true"><strong class="xi2">{lang search}</strong></button></td>
  5.                                 <td class="scbar_hot_td">
  6.                                         <div id="scbar_hot">
  7.                                                 <!--{if $_G['setting']['srchhotkeywords']}-->
  8.                                                         <strong class="xw1">{lang hot_search}: </strong>
  9.                                                         <!--{loop $_G['setting']['srchhotkeywords'] $val}-->
  10.                                                                 <!--{if $val=trim($val)}-->
  11.                                                                         <!--{eval $valenc=rawurlencode($val);}-->
  12.                                                                         <!--{block srchhotkeywords[]}-->
  13.                                                                                 <!--{if !empty($searchparams[url])}-->
  14.                                                                                         <a href="$searchparams[url]?q=$valenc&source=hotsearch{$srchotquery}" target="_blank" class="xi2" sc="1">$val</a>
  15.                                                                                 <!--{else}-->
  16.                                                                                         <a href="search.php?mod=forum&srchtxt=$valenc&formhash={FORMHASH}&searchsubmit=true&source=hotsearch" target="_blank" class="xi2" sc="1">$val</a>
  17.                                                                                 <!--{/if}-->
  18.                                                                         <!--{/block}-->
  19.                                                                 <!--{/if}-->
  20.                                                         <!--{/loop}-->
  21.                                                         <!--{echo implode('', $srchhotkeywords);}-->
  22.                                                 <!--{/if}-->
  23.                                         </div>
  24.                                 </td>
復(fù)制代碼

模板中的pubsearchform.php代碼如下

  1. <!--{if $_G['setting']['search']}-->
  2.         <!--{eval $slist = array();}-->
  3.         <!--{if $_G['fid'] && $_G['forum']['status'] != 3 && $mod != 'group'}--><!--{block slist[forumfid]}--><li><a href="javascript:;" rel="curforum" fid="$_G[fid]" >{lang search_this_forum}</a></li><!--{/block}--><!--{/if}-->
  4.         <!--{if $_G['setting']['portalstatus'] && $_G['setting']['search']['portal']['status'] && ($_G['group']['allowsearch'] & 1 || $_G['adminid'] == 1)}--><!--{block slist[portal]}--><li><a href="javascript:;" rel="article">{lang article}</a></li><!--{/block}--><!--{/if}-->
  5.         <!--{if $_G['setting']['search']['forum']['status'] && ($_G['group']['allowsearch'] & 2 || $_G['adminid'] == 1)}--><!--{block slist[forum]}--><li><a href="javascript:;" rel="forum" class="curtype">{lang thread}</a></li><!--{/block}--><!--{/if}-->
  6.         <!--{if helper_access::check_module('blog') && $_G['setting']['search']['blog']['status'] && ($_G['group']['allowsearch'] & 4 || $_G['adminid'] == 1)}--><!--{block slist[blog]}--><li><a href="javascript:;" rel="blog">{lang blog}</a></li><!--{/block}--><!--{/if}-->
  7.         <!--{if helper_access::check_module('album') && $_G['setting']['search']['album']['status'] && ($_G['group']['allowsearch'] & 8 || $_G['adminid'] == 1)}--><!--{block slist[album]}--><li><a href="javascript:;" rel="album">{lang album}</a></li><!--{/block}--><!--{/if}-->
  8.         <!--{if $_G['setting']['groupstatus'] && $_G['setting']['search']['group']['status'] && ($_G['group']['allowsearch'] & 16 || $_G['adminid'] == 1)}--><!--{block slist[group]}--><li><a href="javascript:;" rel="group">$_G['setting']['navs'][3]['navname']</a></li><!--{/block}--><!--{/if}-->
  9.         <!--{block slist[user]}--><li><a href="javascript:;" rel="user">{lang users}</a></li><!--{/block}-->
  10. <!--{/if}-->
  11. <!--{if $_G['setting']['search'] && $slist}-->
  12. <div id="scbar" class="{if $_G['setting']['srchhotkeywords'] && count($_G['setting']['srchhotkeywords']) > 5}scbar_narrow {/if}cl">
  13.         <form id="scbar_form" method="{if $_G[fid] && !empty($searchparams[url])}get{else}post{/if}" autocomplete="off" onsubmit="searchFocus($('scbar_txt'))" action="{if $_G[fid] && !empty($searchparams[url])}$searchparams[url]{else}search.php?searchsubmit=yes{/if}" target="_blank">
  14.                 <input type="hidden" name="mod" id="scbar_mod" value="search" />
  15.                 <input type="hidden" name="formhash" value="{FORMHASH}" />
  16.                 <input type="hidden" name="srchtype" value="title" />
  17.                 <input type="hidden" name="srhfid" value="$_G[fid]" />
  18.                 <input type="hidden" name="srhlocality" value="$_G['basescript']::{CURMODULE}" />
  19.                 <!--{if !empty($searchparams[params])}-->
  20.                         <!--{loop $searchparams[params] $key $value}-->
  21.                         <!--{eval $srchotquery .= '&' . $key . '=' . rawurlencode($value);}-->
  22.                         <input type="hidden" name="$key" value="$value" />
  23.                         <!--{/loop}-->
  24.                         <input type="hidden" name="source" value="discuz" />
  25.                         <input type="hidden" name="fId" id="srchFId" value="$_G[fid]" />
  26.                         <input type="hidden" name="q" id="cloudsearchquery" value="" />
  27.                         <style>
  28.                         #scbar { overflow: visible; position: relative; }
  29.                         #sg{ background: #FFF; width:456px; border: 1px solid #B2C7DA; }
  30.                         .scbar_narrow #sg { width: 316px; }
  31.                         #sg li { padding:0 8px; line-height:30px; font-size:14px; }
  32.                         #sg li span { color:#999; }
  33.                         .sml { background:#FFF; cursor:default; }
  34.                         .smo { background:#E5EDF2; cursor:default; }
  35.             </style>
  36.             <div style="display: none; position: absolute; top:37px; left:44px;" id="sg">
  37.                 <div id="st_box" cellpadding="2" cellspacing="0"></div>
  38.             </div>
  39.                 <!--{/if}-->
  40.                 <table cellspacing="0" cellpadding="0">
  41.                         <tr>
  42.                                 <td class="scbar_txt_td"><input type="text" name="srchtxt" id="scbar_txt" value="{lang enter_content}" autocomplete="off" x-webkit-speech speech /></td>
  43.                                 <td class="scbar_type_td"><a href="javascript:;" id="scbar_type" class="xg1" onclick="showMenu(this.id)" hidefocus="true">{lang search}</a></td>
  44.                                 <td class="scbar_btn_td"><button type="submit" name="searchsubmit" id="scbar_btn" sc="1" class="pn pnc" value="true"><strong class="xi2">{lang search}</strong></button></td>

  45.                         </tr>
  46.                 </table>
  47.         </form>
  48. </div>
  49. <ul id="scbar_type_menu" class="p_pop" style="display: none;"><!--{echo implode('', $slist);}--></ul>
  50. <script type="text/javascript">
  51.         initSearchmenu('scbar', '$searchparams[url]');
  52. </script>
  53. <script type="text/javascript">
  54.     jQuery(function(){
  55. jQuery("#scbar #scbar_txt").focus(function(){
  56.   jQuery("#scbar").addClass("bgchange");
  57. }).blur(function(){
  58.   jQuery("#scbar").removeClass("bgchange");
  59. });
  60.     })
  61. </script>
  62. <!--{/if}-->
復(fù)制代碼




作者: 老周部落    時(shí)間: 2022-2-10 21:37
您找個(gè)比對(duì)工具比對(duì)一下兩邊模板完了對(duì)照修改即可,另外 CDN 不要緩存動(dòng)態(tài)頁面否則就會(huì)報(bào)錯(cuò)
作者: celover    時(shí)間: 2022-2-15 14:16
老周部落 發(fā)表于 2022-2-10 21:37
您找個(gè)比對(duì)工具比對(duì)一下兩邊模板完了對(duì)照修改即可,另外 CDN 不要緩存動(dòng)態(tài)頁面否則就會(huì)報(bào)錯(cuò) ...

后來我又試了下,發(fā)現(xiàn)跟模板沒有關(guān)系,我用默認(rèn)的模板也會(huì)出錯(cuò)。

我有兩個(gè)網(wǎng)站,一個(gè)用的是百度的免費(fèi)cdn加速,一個(gè)是用的百度付費(fèi)的cdn加速,免費(fèi)的搜索不會(huì)出錯(cuò),付費(fèi)的會(huì)出錯(cuò)。

但是付費(fèi)的我把cdn加速給關(guān)了,還是不行,不知道到底是什么問題?
作者: celover    時(shí)間: 2022-2-15 14:19
老周部落 發(fā)表于 2022-2-10 21:37
您找個(gè)比對(duì)工具比對(duì)一下兩邊模板完了對(duì)照修改即可,另外 CDN 不要緩存動(dòng)態(tài)頁面否則就會(huì)報(bào)錯(cuò) ...

(, 下載次數(shù): 82)

我把CDN緩存設(shè)置了只緩存靜態(tài)頁面,也不行?

作者: 老周部落    時(shí)間: 2022-2-15 16:16
celover 發(fā)表于 2022-2-15 14:19
我把CDN緩存設(shè)置了只緩存靜態(tài)頁面,也不行?

頁面是不能緩存的,Discuz! 的 html 實(shí)際上還是動(dòng)態(tài)執(zhí)行的。
只能開 圖像/JS/CSS 緩存
作者: celover    時(shí)間: 2022-2-16 08:17
老周部落 發(fā)表于 2022-2-15 16:16
頁面是不能緩存的,Discuz! 的 html 實(shí)際上還是動(dòng)態(tài)執(zhí)行的。
只能開 圖像/JS/CSS 緩存 ...

關(guān)于搜索的頁面是那幾個(gè),我設(shè)置對(duì)這幾個(gè)頁面不緩存可以嗎?
作者: 老周部落    時(shí)間: 2022-2-16 08:50
celover 發(fā)表于 2022年2月16日 中國標(biāo)準(zhǔn)時(shí)間 上午8:17:03

頁面是不能緩存的,Discuz! 的 html 實(shí)際上還是動(dòng)態(tài)執(zhí)行的。
只能開 圖像/JS/CSS 緩存 ...
關(guān)于搜索的頁面是那幾個(gè),我設(shè)置對(duì)這幾個(gè)頁面不緩存可以嗎?

那個(gè)搜索條是全局的。
作者: celover    時(shí)間: 2022-2-18 15:26
老周部落 發(fā)表于 2022-2-16 08:50
那個(gè)搜索條是全局的。

用了緩存,為啥不登陸會(huì)報(bào)錯(cuò),登錄了就不會(huì)報(bào)錯(cuò)了呢。
作者: 老周部落    時(shí)間: 2022-2-18 22:19
celover 發(fā)表于 2022-2-18 15:26
用了緩存,為啥不登陸會(huì)報(bào)錯(cuò),登錄了就不會(huì)報(bào)錯(cuò)了呢。

CDN 檢測(cè)到登錄了就不會(huì)緩存了,這是 CDN 的策略。
作者: ysx24    時(shí)間: 2022-2-19 04:09
我曾有和你一樣的問題,搞了好幾天又各種工單,登陸緩存問題解決了又面臨帖子異常,對(duì),說的就是騰訊cdn,最后實(shí)在沒辦法就放棄
不清楚你用的是哪里cdn,如果是騰訊在緩存那里有個(gè)不緩存asp、php等,新增個(gè)不緩存“/”  即可解決

換了阿里cdn什么問題都沒了

作者: ysx24    時(shí)間: 2022-2-19 04:18
百度cdn用過,除了或許對(duì)收錄有幫助,其余一無是處
個(gè)人使用體驗(yàn)  騰訊的最快、阿里節(jié)點(diǎn)好,七牛一般、百度最垃圾




歡迎光臨 Discuz! 官方交流社區(qū) (http://m.sdtechgong.com.cn/) Powered by Discuz! X5.0