Forums / General / weird ascii null in output

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

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
Exponential 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 ;-)