Forums / General / weird text at start of page
Scott Foster
Monday 20 December 2010 1:12:58 am
Sometimes I see text like $arr_14 ) ) ); ?> or "/> " /> at the VERY beginning of the page. Clearing template cache fixes this immediately, but is there anyway to prevent things like this from happening or know what might be causing this?
Jérôme Vieilledent
Monday 20 December 2010 1:45:05 am
Hi Scott
Which version of eZ Publish do you use ? Which version of PHP ?
I had this issue with eZ Publish versions prior to 4.1.4, running with PHP 5.3 (eZ is compatible with PHP 5.3 from v4.1.4)
Steven E. Bailey
Monday 20 December 2010 2:54:30 am
I remember this happening at some point and it turned out to be incorrectly closed ini files (opened with <? but not closed with ?> or with junk after the ?>). Although the $array_14 points to a failure in a template. I had a shell script template checker in contributions somewhere but I can't find it now... so I'll paste it here - it might be useful in tracking down stranded tags:
#!/bin/bash tplfile=${@:$#} cmd=`basename $0` #case {case {[/c][ca][as][se][e/]} gettags () { cat - <<EOF |grep -v "^#" div <div </div> span <span </span> li <li[^n] </li> ul <ul </ul> ol <ol </ol> tr <tr </tr> td <td </td> table <table </table> if {if {/if} {else case {case {/case} switch {switch {/switch} let {let {/let} default {default {/default} foreach {foreach {/foreach} section {section[^-] {/section} {section- append {append-block {/append-block} cache {cache-block {/cache-block} bracket-space {[[:space:]] this_should_never_match_on_anything EOF } matchtag () { matchtag=`echo $1|sed 's/\[.*\]$//'` #This is needed to stop the <li cat "$tplfile"|grep "$1"| #from matching on link with <li[^n] awk -v matchtag=$matchtag -v endtag=$endtag -v elsetag=${elsetag:-"this_is_a_long_dummy_string"} 'BEGIN{FS=endtag}{ for(i=1;i<=NF;i++) { if ( matchtag != elsetag && $i ~ elsetag ) { continue } else { if ( $i ~ matchtag ) {total = total + 1} } } } END { print total }' } checktags () { else=0 dirtyflag=0 elsetag="" gettags|while read label opentag closetag elsetag do endtag=${closetag:$((${#closetag} - 1)):1} closetag=${closetag:0:$((${#closetag} - 1))} open=`matchtag $opentag|tail -1` close=`matchtag $closetag|tail -1` if [ -n "$elsetag" ] then else=`matchtag $elsetag|tail -1` if [ "${opt}" = "-v" ] then echo $label $opentag ${open:-0} $closetag ${close:-0} ${else:+elsetag $else} fi else if [ "${opt}" = "-v" ] then echo $label $opentag ${open:-0} $closetag ${close:-0} fi fi if [ "${open:-0}" -ne "${close:-0}" ] then if [ "$1" = "verbose" ] then echo -e "Uneven ${label} tags: ${label}-open: ${open:-0} ${label}-close: ${close:-0}\c" if [ -n "$elsetag" -a ${else:-0} -ne 0 ] then echo -e " ${label}-else: ${else:-0}\c" fi echo else dirtyflag=1 echo $dirtyflag fi fi done } ######## # MAIN # ######## if [ $# -lt 1 ] then echo -e "Usage:\t $cmd <file|directory>" echo -e "\t\t<directory> is recursive" echo -e "\t\t-v (verbose) also displays clean files" exit elif [ "$1" != "$tplfile" -a "$1" = "-v" ] then opt="-v" fi if [ "$tplfile" = "." ] then tplfile=$PWD elif [ "$tplfile" = ".." ] then tplfile=`dirname $PWD` fi if [ -d "$tplfile" ] then echo "#### Starting from $tplfile ####" find $tplfile -name "*.tpl" -print|while read file do $0 ${opt} ${file} done exit fi dirtyflag=`checktags` if [ -n "${dirtyflag}" ] then echo "##### "$tplfile" #####" checktags verbose elif [ "${opt}" = "-v" ] then echo "##### "$tplfile" #####" echo "`basename $tplfile` appears clean" fi
Certified eZPublish developer http://ez.no/certification/verify/396111 Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com
Monday 20 December 2010 6:51:07 am
running PHP 5.3.3 with eZ Publish 4.3