Explorar el Código

php8.2及以上支持

tags/6.5.6
tianya hace 4 días
padre
commit
217a4920b7
Se han modificado 3 ficheros con 25 adiciones y 6 borrados
  1. +19
    -0
      dedebiz
  2. +1
    -1
      src/admin/makehtml_homepage.php
  3. +5
    -5
      src/apps/advancedsearch.php

+ 19
- 0
dedebiz Ver fichero

@@ -617,6 +617,25 @@ if (count($argv) > 1 && ($argv[1] == "serv" || $argv[1] == "s")) {
}
file_put_contents(DEDEDATA.'/admin/files.txt',json_encode($hashs));
DedeCli::write("成功生成文件哈希");
} else if(count($argv) > 1 && ($argv[1] =="find_stringvals")){
// 用于找出php8.2字符串变量的
function searchPhpFiles($directory) {
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory));
$variablePattern = '/["\'].*?\$\{\$\w+\}.*?["\']/';
foreach ($iterator as $file) {
if ($file->isFile() && pathinfo($file, PATHINFO_EXTENSION) === 'php') {
$filePath = $file->getPathname();
$lines = file($filePath, FILE_IGNORE_NEW_LINES);
foreach ($lines as $lineNumber => $line) {
if (preg_match($variablePattern, $line)) {
DedeCli::write( "文件: $filePath, 行号: ". ($lineNumber + 1). ", 内容: ". trim($line));
}
}
}
}
}
searchPhpFiles($workDir);
} else {
DedeCli::write($helpStr);
}

+ 1
- 1
src/admin/makehtml_homepage.php Ver fichero

@@ -36,7 +36,7 @@ if ($dopost == "view") {
$data = $client->AdminPWDCreate($dedebiz_admin);
if ($data->data != "ok") {
echo "<link rel=\"stylesheet\" href=\"/static/web/css/bootstrap.min.css\"><style>.modal {position:static}</style>";
echo "<div class=\"alert alert-warning\">密码失败:${$data}</div><br>";
echo "<div class=\"alert alert-warning\">密码失败:{${$data}}</div><br>";
$client->Close();
exit;
}


+ 5
- 5
src/apps/advancedsearch.php Ver fichero

@@ -103,33 +103,33 @@ if (empty($sql)) {
if (isset(${'start'.$var}) && trim(${'start'.$var}) != '') {
${'start'.$var} = trim(${'start'.$var});
${'start'.$var} = intval(${'start'.$var});
$where .= " AND addon.$var>${'start' .$var} ";
$where .= " AND addon.$var>{${'start' .$var}} ";
}
if (isset(${'end'.$var}) && trim(${'end'.$var}) != '') {
${'end'.$var} = trim(${'end'.$var});
${'end'.$var} = intval(${'end'.$var});
$where .= " AND addon.$var<${'end' .$var} ";
$where .= " AND addon.$var<{${'end' .$var}} ";
}
} elseif (in_array($type, $textarr)) {
if (isset(${$var}) && trim(${$var}) != '') {
${$var} = stripslashes(${$var});
${$var} = preg_replace("#[\|\"\r\n\t%\*\?\(\)\$;,'%<>]#", "", trim(${$var}));
${$var} = addslashes(${$var});
$where .= " AND addon.$var LIKE '%${$var}%'";
$where .= " AND addon.$var LIKE '%{${$var}}%'";
}
} elseif ($type == 'select') {
${$var} = stripslashes(${$var});
${$var} = preg_replace("#[\|\"\r\n\t%\*\?\(\)\$;,'%<>]#", "", trim(${$var}));
${$var} = addslashes(${$var});
if (${$var} != '') {
$where .= " AND addon.$var LIKE '${$var}'";
$where .= " AND addon.$var LIKE '{${$var}}'";
}
} elseif ($type == 'radio') {
${$var} = stripslashes(${$var});
${$var} = preg_replace("#[\|\"\r\n\t%\*\?\(\)\$;,'%<>]#", "", trim(${$var}));
${$var} = addslashes(${$var});
if (${$var} != '') {
$where .= " AND addon.$var LIKE '${$var}'";
$where .= " AND addon.$var LIKE '{${$var}}'";
}
} elseif ($type == 'checkbox') {
if (is_array(${$var}) && !empty(${$var})) {


Cargando…
Cancelar
Guardar