php 5.5.x 사용시 preg_replace(): The /e modifier is deprecated 문제
php 5.5를 사용하다가 보니깐 preg_replace 그누보드 스킨이나 아미나 스킨시 /e 옵션 준것에 오류가 발생하더라구요..
이문제를 해결하기 위해서 preg_replace_callback 을 사용하라구 하네요..
예. amina/lib/view.lib.php
625 라인 근처
//Video
원본: $content = preg_replace("/{동영상\:([^}]*)}/ie", "amina_video_content('\\1','{$mobile}')", $content);
수정: $content = preg_replace_callback("/{동영상\:([^}]*)}/i",
function ($matches) {
amina_video_content('$matches[1]','{$mobile}');
}, $content);
==================================================================================
//SoundCloud
원본 : $content = preg_replace("/\[soundcloud(.*)\/\]/ies", "amina_soundcloud('\\1')", $content);
수정: $content = preg_replace_callback("/\[soundcloud(.*)\/\]/is",
function ($matches) {
amina_soundcloud('$matches[1]');
}, $content);
이런식으로 수정해주시면 될껍니다.
php 버전업에 대비해서 참고해주세요^^
이문제를 해결하기 위해서 preg_replace_callback 을 사용하라구 하네요..
예. amina/lib/view.lib.php
625 라인 근처
//Video
원본: $content = preg_replace("/{동영상\:([^}]*)}/ie", "amina_video_content('\\1','{$mobile}')", $content);
수정: $content = preg_replace_callback("/{동영상\:([^}]*)}/i",
function ($matches) {
amina_video_content('$matches[1]','{$mobile}');
}, $content);
==================================================================================
//SoundCloud
원본 : $content = preg_replace("/\[soundcloud(.*)\/\]/ies", "amina_soundcloud('\\1')", $content);
수정: $content = preg_replace_callback("/\[soundcloud(.*)\/\]/is",
function ($matches) {
amina_soundcloud('$matches[1]');
}, $content);
이런식으로 수정해주시면 될껍니다.
php 버전업에 대비해서 참고해주세요^^
댓글 2개
10년 전
대~~~~박
전 이걸 지금 알았는데 이미 2년 전에 알고 계셨군요.
덕분에 해결 됐습니다. ^^
전 이걸 지금 알았는데 이미 2년 전에 알고 계셨군요.
덕분에 해결 됐습니다. ^^
ifelse
5년 전
7.2대응소스코드
게시글 목록
| 번호 | 제목 |
|---|---|
| 33411 | |
| 33410 | |
| 33409 | |
| 33408 | |
| 33407 | |
| 33404 | |
| 33403 | |
| 33402 | |
| 33399 | |
| 33398 | |
| 33390 | |
| 33386 | |
| 33377 | |
| 33356 | |
| 33348 | |
| 33340 | |
| 33334 | |
| 33333 | |
| 33329 | |
| 33322 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기