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

標(biāo)題: showmessage函數(shù)的一個Bug [打印本頁]

作者: 高歌    時間: 2024-4-8 16:25
標(biāo)題: showmessage函數(shù)的一個Bug
showmessage('請選擇正確的操作', '', array(), array('showdialog' => 0, 'showmsg' => true));
原想:通過以上函數(shù)提示用戶操作出問題,頁面不跳轉(zhuǎn),

沒有帶參數(shù) 'locationtime'=>true 結(jié)果還是跳轉(zhuǎn)了,跟蹤代碼發(fā)現(xiàn)以上函數(shù)調(diào)用的是 function_message.php的
函數(shù)  function dshowmessage($message, $url_forward = '', $values = array(), $extraparam = array(), $custom = 0)



  1.         $param = array(
  2.                 'header'        => false,
  3.                 'timeout'        => null,
  4.                 'refreshtime'        => null,
  5.                 'closetime'        => null,
  6.                 'locationtime'        => null,
  7.                 'alert'                => null,
  8.                 'return'        => false,
  9.                 'redirectmsg'        => 0,
  10.                 'msgtype'        => 1,
  11.                 'showmsg'        => true,
  12.                 'showdialog'        => false,
  13.                 'login'                => false,
  14.                 'handle'        => false,
  15.                 'extrajs'        => '',
  16.                 'striptags'        => true,
  17.         );
復(fù)制代碼



雖然后面有
  1.         if($param['locationtime'] !== null) {
  2.                 $param['locationtime'] = $param['locationtime'] === true ? $timedefault : $param['locationtime'];
  3.         }
復(fù)制代碼


據(jù)測試(php 7.4)這個條件一直是成立的,也就是一定會進入,給賦值頁面刷新的時間。

請查一下是不是一個Bug

作者: 高歌    時間: 2024-4-8 16:31
可能不是bug,是我搞錯了!

帖子不能刪啊?




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