weird ascii null in output

Author Message

Arno Lehmann

Thursday 12 February 2009 2:42:38 pm

Hi,

I encounter a funny thing here which I don't understand at all:

I have a template where, from some data passed in, I create output. Nothing uncommon so far. But, in ONE case ONLY (as far as I know now...) I get an ascii Null char in the resulting text.

This is the code snipped in question:

  {def $submitto=''}
  {if $data._submitto|is_string()}
    {set $submitto=$data._submitto}
  {/if}
  {def $form=concat('<form method="post" action=', $submitto|ezurl(), '>')}

$submitto is passed in as "/xxcontact/minireg"- that part works correctly.

Now, this is what I get:

wget -O - https://www.whatever.com/eng/xxcontact/minireg 2>/dev/null | grep -a 'action="/eng.*minireg' | hexdump -C
00000000  20 20 3c 66 6f 72 6d 20  6d 65 74 68 6f 64 3d 22  |  <form method="|
00000010  70 6f 73 74 22 20 61 63  74 69 6f 6e 3d 22 2f 65  |post" action="/e|
00000020  6e 67 2f <b>00</b> 62 73 63 6f  6e 74 61 63 74 2f 6d 69  |ng/.xxcontact/mi|
00000030  6e 69 72 65 67 22 3e 0a                           |nireg">.|
00000038

Notice the ascii Null before .xxcontact?

Now, I can leave out the ezurl() call, then I get the URL passed in, but again with ascii Null prepended.

So, my conclusion is that either the template framework or php itself is responsible. But - how do I fix this?

I use basically identical approaches for the creation of action urls in about 50 other places where I never observed this...

php is version 5.1.6, Zend engine is 2.1.0
eZ Publish is version 4.0.0 (yeah, I know there is a bug fix version available...)

Arno Lehmann

Thursday 12 February 2009 3:07:07 pm

done more checking.

Problem solved: PEBKAC :-(

Still something funny happening inside php, but at least whatever does it is no longer happening for this program...

Thanks for your thoughts ;-)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 18:21:04
Script start
Timing: Jan 18 2025 18:21:04
Module start 'layout'
Timing: Jan 18 2025 18:21:04
Module start 'content'
Timing: Jan 18 2025 18:21:05
Module end 'content'
Timing: Jan 18 2025 18:21:05
Script end

Main resources:

Total runtime0.5924 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 587.9063152.6250
Module start 'layout' 0.00570.0038 740.531339.4453
Module start 'content' 0.00950.5817 779.9766428.2031
Module end 'content' 0.59120.0012 1,208.17978.1641
Script end 0.5923  1,216.3438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.6012160.0002
Check MTime0.00170.2796160.0001
Mysql Total
Database connection0.00060.098910.0006
Mysqli_queries0.544891.9750520.0105
Looping result0.00050.0909500.0000
Template Total0.556093.920.2780
Template load0.00220.376320.0011
Template processing0.553793.476320.2769
Template load and register function0.00020.033210.0002
states
state_id_array0.00150.251010.0015
state_identifier_array0.00150.248720.0007
Override
Cache load0.00190.3195220.0001
Sytem overhead
Fetch class attribute can translate value0.00120.197310.0012
Fetch class attribute name0.00240.408320.0012
XML
Image XML parsing0.00010.018610.0001
class_abstraction
Instantiating content class attribute0.00000.001220.0000
General
dbfile0.00080.1315100.0001
String conversion0.00000.001540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs