From 67ed38ffda92515ba3c9c62fb59a6e3bc8d21c66 Mon Sep 17 00:00:00 2001 From: Anyon Date: Sat, 19 Sep 2020 18:17:05 +0800 Subject: [PATCH] Update sys.php --- app/admin/sys.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/admin/sys.php b/app/admin/sys.php index a0e52891a..e312efd01 100644 --- a/app/admin/sys.php +++ b/app/admin/sys.php @@ -23,18 +23,18 @@ app()->db->listen(function ($sqlstr) { [$sqlstr] = explode('GROUP BY', explode('ORDER BY', $sqlstr)[0]); if (preg_match('/^INSERT\s+INTO\s+`(.*?)`\s+SET\s+(.*?)\s*$/i', $sqlstr, $matches)) { if (stripos($matches[1] = Str::studly($matches[1]), 'SystemOplog') === false) { - $matches[2] = substr(str_replace('`', '', $matches[2]), 0, 200); + $matches[2] = substr(str_replace(['`', '\''], '', $matches[2]), 0, 200); return sysoplog("添加数据 {$matches[1]}", "添加数据:{$matches[2]}"); } } elseif (preg_match('/^UPDATE\s+`(.*?)`\s+SET\s+(.*?)\s+WHERE\s+(.*?)\s*$/i', $sqlstr, $matches)) { if (stripos($matches[1] = Str::studly($matches[1]), 'SystemOplog') === false) { - $matches[3] = substr(str_replace('`', '', $matches[3]), 0, 200); - $matches[2] = substr(str_replace('`', '', $matches[2]), 0, 200); + $matches[3] = substr(str_replace(['`', '\''], '', $matches[3]), 0, 200); + $matches[2] = substr(str_replace(['`', '\''], '', $matches[2]), 0, 200); return sysoplog("更新数据 {$matches[1]}( {$matches[3]} )", "更新内容:{$matches[2]}"); } } elseif (preg_match('/^DELETE\s*FROM\s*`(.*?)`\s*WHERE\s*(.*?)\s*$/i', $sqlstr, $matches)) { if (stripos($matches[1] = Str::studly($matches[1]), 'SystemOplog') === false) { - $matches[2] = str_replace('`', '', $matches[2]); + $matches[2] = str_replace(['`', '\''], '', $matches[2]); return sysoplog("删除数据 {$matches[1]}", "删除条件:{$matches[2]}"); } }