-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed #18592: php warning on array_merge when 2nd arg is not an array #139
Conversation
…, when a datatype template contains no \n
@@ -1757,7 +1757,7 @@ class eZTemplate | |||
if ( eZTemplate::isXHTMLCodeIncluded() ) | |||
$preText .= "<p class=\"small\">$path</p><br/>\n"; | |||
$postText = "\n<!-- STOP: including template: $path ($uri) -->\n"; | |||
$root[1] = array_merge( array( eZTemplateNodeTool::createTextNode( $preText ) ), $root[1] ); | |||
$root[1] = array_merge( array( eZTemplateNodeTool::createTextNode( $preText ) ), is_array( $root[1] ) ? $root[1] : array() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't have to do a merge at all if it is not an array.
Also note that our coding standards mentions having newlines at the end of the file (except in ezxmltext templates), that would avoid this issue wouldn't it? |
Yes it would! => So I can close this pull request? |
http://share.ez.no/blogs/bertrand-dunogier/the-ez-coding-standards-need-you As for closing or not, what do you/others think? |
New commit André from your remark. Concerning the standards, some remarks: So for all those reasons (specially 4/ that says \n should be added to all files, except some... (and maybe others in the future)), I would say it would be nice to add an extra check to avoid this warning that may occur quite often (6/) just my 2 cents :) |
Fixed #18592: php warning on array_merge when 2nd arg is not an array
Agreed, merged, closed, thanks :) |
…perly clear the cache (ezsystems#139)
Fixed #18592: php warning on array_merge when 2nd arg is not an array, when a datatype template contains no \n