질문하기 전에 일단 구글링으로 스스로 해결해보는게 맞다고 생각해서 열심히 찾아보았는데, 아래코드에서 "create_function()" 함수 자체가 php8.0에서는 제거되어 에러가 발생하는 것 같습니다.
<?php /** * @ Lazyload addon * @ author karma <[email protected]> * @ Using Vanilla JavaScript plugin for lazyloading images * @ https://github.com/tuupola/jquery_lazyload/tree/2.x */ if(!defined("__XE__")) exit(); if(isCrawler()) return; if($called_position != 'before_display_content' || Context::get('module') == 'admin') return; if(!$addon_info->bgc) $addon_info->bgc = 'gray.png'; $GLOBALS['__LAZYLOAD__']['bgc'] = $addon_info->bgc ; include_once("lazyload.lib.php"); $pattern_image_tag = "/<img(.*?)(src=\"[^\040]*)(.*)(files\/attach\/images\/[^\"]+)+([^>]*?)(>)+/i"; $pattern_documents_area = '/<!--Before(Document|Comment)\([0-9]+,[0-9]+\)-->(.*?)<!--After(Document|Comment)\([0-9]+,[0-9]+\)-->/is'; $output = preg_replace_callback($pattern_documents_area,create_function('$matches',"return preg_replace_callback('$pattern_image_tag', 'lazyloadImage', \$matches[0]);"), $output); Context::loadFile(array('./addons/lazyload/lazyload.js','', '', null), true);
위에서 create_function 함수 구문을 어떻게 수정하면 php8.0에서도 작동하도록 대체가 가능할까요?!