【问题标题】:Error "Illegal string offset" After PHP UpgradePHP 升级后出现“非法字符串偏移”错误
【发布时间】:2020-03-01 08:57:54
【问题描述】:

警告 [2] 非法字符串偏移 'title' - Line: 66


if(!isset($params['title'])) {
    $params['title'] = "Hidden Content";
  }

和警告 [2] 非法字符串偏移 'title' - Line: 3

  eval("\$return = \"".$templates->get("lock_wrapper")."\";");

出现错误的页面:https://findjobsarkari.in/showthread.php?tid=1 文件的完整代码在这里:https://pastebin.com/rBZEmJc8

【问题讨论】:

  • 尝试使用:isset($a['title']) !== false 代替 !isset($params['title'])

标签: php


【解决方案1】:

尝试改变:

if(!isset($params['title'])) {
    $params['title'] = "Hidden Content";
}

$params['title'] = $params["title] ?? "Hidden Content";

【讨论】:

  • 尝试if(@!isset($params['title'])) { 而不是if(!isset($params['title'])) {
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多