PHP 7.2에서 배열이 아닌 것에 count()를 사용하여 발생하는 오류 수정#2377
Open
kijin wants to merge 2 commits intoxpressengine:developfrom
Open
PHP 7.2에서 배열이 아닌 것에 count()를 사용하여 발생하는 오류 수정#2377kijin wants to merge 2 commits intoxpressengine:developfrom
kijin wants to merge 2 commits intoxpressengine:developfrom
Conversation
|
이 pr을 적용하니 |
|
무슨 말씀이시죠?
2019년 3월 15일 (금) 오후 9:22, wookho <notifications@github.com>님이 작성:
… 이 pr을 적용하니
DBMysqli_innodb.class.php에서 PHP Fatal error: Allowed memory size of
268435456 bytes exhausted 에러가 납니다. 500에러로 사이트 접속이 안되어 원복했습니다.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2377 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AgxJdGiz9Iz_tBc4VRg7rUHF2AWNf450ks5vW5CYgaJpZM4a4qv0>
.
|
|
@tychetic 이 PR을 저희 사이트에 적용하니 위와 같은 에러로 인해 사이트가 접속이 안되고 500에러가 출력된다는 보고입니다. |
Contributor
|
@tychetic 이메일로 전달 받으신 내용을 그대로 무슨내용인지 확인하지 못하여 생기는 오해같습니다. |
Contributor
Author
|
@kijin 방금 바꿔주신 부분 사이트에 다시 적용해 봤습니다. 쿼리수량이 제한되지 않아 메모리가 즉시 소진되어 다운되는 현상이 없어졌습니다. 살펴주셔서 감사합니다. XE코어에서 꼭 고쳐져야 할 부분인 듯 해서 사이트에 먼저 적용해 보려 시도했을때 다운되는 현상이 있어 저희 사이트가 특별한 오류를 가지고 있는 지 무척 걱정되어 저희 사이트에서의 현상을 알려드리게 되었습니다. 잘 살펴봐주셔서 이상이 없게 고쳐진 것 같습니다. 검토해주셔서 감사합니다. |
dorami
added a commit
to daolcms/daolcms
that referenced
this pull request
Jun 6, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PHP 7.2 이상 버전에서는 배열이나 countable object가 아닌 것에 count() 함수를 사용하면 오류를 뿜습니다. 예전부터 배열이 아닌 것에도 흔히 사용하던 함수인데, 갑자기 에러 레벨이 확 올라가 버렸어요. (수정: 커밋 메시지와 달리 현재는 Fatal Error는 아닙니다. 변수가 countable인지 확인하는 함수는 PHP 7.3에서야 추가되었습니다. 앞뒤 안 가리고 무척 빨리 바뀌고 있는 것 같으니 차기 버전에서는 아예 Fatal Error가 되어 버릴지도 모르겠네요.)
이 문제 때문에 특정한 상황에서 오류가 발생하는 것을 발견하여, 반드시 배열 여부를 확인한 후 count() 함수를 사용하도록 수정합니다.
이것 외에도 count() 함수를 사용하는 곳은 많지만, 일단 오류가 발생할 여지가 있는 곳만 수정했습니다.
참고: rhymix/rhymix@6f35f5b