PHP8.1 에 대응하기 위해 deprecated 되는 오류 등 수정

This commit is contained in:
EC2 Default User
2022-03-14 00:53:09 +00:00
parent 26dfe6379f
commit 2e7953daba
5 changed files with 22 additions and 6 deletions

View File

@ -28,7 +28,7 @@ $bo_include_head = isset($_POST['bo_include_head']) ? preg_replace(array("#[\\\]
$bo_include_tail = isset($_POST['bo_include_tail']) ? preg_replace(array("#[\\\]+$#", "#(<\?php|<\?)#i"), "", substr($_POST['bo_include_tail'], 0, 255)) : '';
// 관리자가 자동등록방지를 사용해야 할 경우
if ($board && ($board['bo_include_head'] !== $bo_include_head || $board['bo_include_tail'] !== $bo_include_tail) && function_exists('get_admin_captcha_by') && get_admin_captcha_by()){
if ($board && (isset($board['bo_include_head']) && $board['bo_include_head'] !== $bo_include_head || $board['bo_include_tail'] !== $bo_include_tail) && function_exists('get_admin_captcha_by') && get_admin_captcha_by()){
include_once(G5_CAPTCHA_PATH.'/captcha.lib.php');
if (!chk_captcha()) {

View File

@ -197,7 +197,7 @@ if (defined('G5_USE_SHOP') && G5_USE_SHOP) {
$result = sql_query("describe `{$g5['g5_shop_post_log_table']}`");
while ($row = sql_fetch_array($result)){
if( $row['Field'] === 'ol_msg' && $row['Type'] === 'varchar(255)' ){
if( isset($row['Field']) && $row['Field'] === 'ol_msg' && $row['Type'] === 'varchar(255)' ){
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` MODIFY ol_msg TEXT NOT NULL;", false);
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` DROP PRIMARY KEY;", false);
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` ADD `log_id` int(11) NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY (`log_id`);", false);

View File

@ -2,7 +2,9 @@
/*******************************************************************************
** 공통 변수, 상수, 코드
*******************************************************************************/
error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING );
// error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING );
error_reporting(E_ALL);
ini_set("display_errors", 1);
// 보안설정이나 프레임이 달라도 쿠키가 통하도록 설정
header('P3P: CP="ALL CURa ADMa DEVa TAIa OUR BUS IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC OTC"');

View File

@ -1511,7 +1511,7 @@ function hsc($str)
// &nbsp; &amp; &middot; 등을 정상으로 출력
function html_symbol($str)
{
return preg_replace("/\&([a-z0-9]{1,20}|\#[0-9]{0,3});/i", "&#038;\\1;", $str);
return $str ? preg_replace("/\&([a-z0-9]{1,20}|\#[0-9]{0,3});/i", "&#038;\\1;", $str) : "";
}
@ -1609,7 +1609,11 @@ function sql_query($sql, $error=G5_DISPLAY_SQL_ERROR, $link=null)
if ($error) {
$result = @mysqli_query($link, $sql) or die("<p>$sql<p>" . mysqli_errno($link) . " : " . mysqli_error($link) . "<p>error file : {$_SERVER['SCRIPT_NAME']}");
} else {
$result = @mysqli_query($link, $sql);
try {
$result = @mysqli_query($link, $sql);
} catch (Exception $e) {
$result = null;
}
}
} else {
if ($error) {
@ -1657,7 +1661,11 @@ function sql_fetch_array($result)
if( ! $result) return array();
if(function_exists('mysqli_fetch_assoc') && G5_MYSQLI_USE)
$row = @mysqli_fetch_assoc($result);
try {
$row = @mysqli_fetch_assoc($result);
} catch (Exception $e) {
$row = null;
}
else
$row = @mysql_fetch_assoc($result);

View File

@ -8319,7 +8319,10 @@ class HTMLPurifier_PropertyListIterator extends FilterIterator
/**
* @return bool
*
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function accept()
{
$key = $this->getInnerIterator()->key();
@ -8437,7 +8440,10 @@ class HTMLPurifier_StringHash extends ArrayObject
* Retrieves a value, and logs the access.
* @param mixed $index
* @return mixed
*
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function offsetGet($index)
{
$this->accessed[$index] = true;