ActiveState Community

PHP debug problem with Smarty-URIs %%

Posted by bugi on 2009-10-26 16:29

I'm encountering problems with debugging URI-filenames generated by Smarty.

Smarty gives me Files in the form:

/var/www/htdocs/template_c/%%F3^F31^F310FF42%%gruppe.html.php

However in debug mode (fully functional with nice URIs ;) this URI seems to get somehow translated to

file://127.0.0.1/var/www/htdocs/template_c/%ó^F3^F310FF42%%gruppe.html

The %F3 gets translated to ó

Is this issue on side of komodo or xdebug?

Any help would be appreciated

Bugi

ericp | Tue, 2009-10-27 09:55

I haven't used Smarty (I only wrote a UDL spec for its colorizer).

The filenames look valid. Whoever is converting them into URIs should
be converting each '%' character into '%25', but I can't tell you offhand
if that's being done by XDebug, Komodo, or Smarty itself.

Is there a way to work around this problem by not using '%' characters
in the generaed filenames?

- Eric

toddw | Tue, 2009-10-27 11:15

It looks like Komodo is doing something strange with the URIs, as Xdebug is correctly escaping the URI and passing it to Komodo as:

<stack where="include" level="0" type="file"
       filename="file:///srv/www/smarty/templates_c/%25%2545%5E45E%5E45E480CD%25%25index.tpl.php"
       lineno="8" />
<stack where="include" level="0" type="file"
       filename="file:///srv/www/smarty/templates_c/%25%2545%5E45E%5E45E480CD%25%25index.tpl.php"
       lineno="8" />

toddw | Wed, 2009-10-28 10:27

I've logged a Komodo bug on this problem here:
http://bugs.activestate.com/show_bug.cgi?id=85096

Your workaround fix is a good idea to get this working correctly for Smarty files.

Cheers,
Todd

bugi | Wed, 2009-10-28 00:37

Thanks for your interest,

I'm circumventing the problem now with a slight change in

Smarty::_get_auto_filename():

by appending an 'X' to the %-sign preventing the de-escaping:

Smarty 2.6.19

Line 1757: $_return .= '%%X' . $_crc32 . '%%X' . $_filename;

ericp | Fri, 2009-10-30 11:11

It should make it to a nightly soon.

Thanks for bringing this to our attention.

- Eric