patch for php8.x

This commit is contained in:
Amberstone 2024-09-27 15:47:15 +09:00
parent 172e4f39d9
commit 05580f9818
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
2 changed files with 15 additions and 5 deletions

View file

@ -475,8 +475,9 @@ if (isset($_REQUEST['url'])) {
} else { } else {
$url = ''; $url = '';
$urlencode = urlencode($_SERVER['REQUEST_URI']); $urlencode = urlencode($_SERVER['REQUEST_URI']);
if (G5_DOMAIN) { if (defined("G5_DOMAIN")) {
$p = @parse_url(G5_DOMAIN); $p = @parse_url(G5_DOMAIN ?? "");
$p['path'] = isset($p['path']) ? $p['path'] : '/';
$urlencode = G5_DOMAIN . urldecode(preg_replace("/^" . urlencode($p['path']) . "/", "", $urlencode)); $urlencode = G5_DOMAIN . urldecode(preg_replace("/^" . urlencode($p['path']) . "/", "", $urlencode));
} }
} }

View file

@ -1586,13 +1586,22 @@ function sql_free_result($result)
return mysql_free_result($result); return mysql_free_result($result);
} }
/**
* MySQL PASSWORD() 함수로 생성된 비밀번호의 hash 값을 반환
*
* MySQL 버전에 따라 결과가 다르게 나올 있음.
* MySQL 8.0.11 버전 이상에서는 오류 발생(PASSWORD 함수가 제거됨)으로 사용할 없음.
*
* @deprecated 함수는 안전하지 않으므로 사용하지 않는 것을 권장
* @see get_encrypt_string() and check_password()
* @param string $value
* @return string
*/
function sql_password($value) function sql_password($value)
{ {
// mysql 4.0x 이하 버전에서는 password() 함수의 결과가 16bytes // mysql 4.0x 이하 버전에서는 password() 함수의 결과가 16bytes
// mysql 4.1x 이상 버전에서는 password() 함수의 결과가 41bytes // mysql 4.1x 이상 버전에서는 password() 함수의 결과가 41bytes
$row = sql_fetch(" select password('$value') as pass "); $row = sql_fetch(" SELECT password('$value') as pass ");
return $row['pass']; return $row['pass'];
} }