This site has been archived. To learn more about our current products Ibexa Content, Ibexa Experience, Ibexa Commerce head over to the Ibexa Developer Portal

eZ Community » Blogs » Steven E. Bailey » Turning off debug for xml output


Turning off debug for xml output

Friday 19 August 2011 9:52:33 am

  • Currently 5 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

So I'm trying to debug a site which has ajax calls to a module that serves xml.  Of course the debug output appended to the xml breaks it.  I've had this problem before but I never bothered looking closer at it until now.

So, I added this:

    if (preg_grep('@Content-Type: text/xml.*@', headers_list() ) )
        return null;

to index.php right after the:

     if ( $ini->variable( 'DebugSettings', 'DebugOutput' ) != 'enabled' )
        return null;

check in the eZDisplayDebug function.  Works like a charm.

So, worth a git pull?  Maybe it should be anything that's not "text/html" instead?  Is there some eZ way of doing this that I overlooked?

Proudly Developed with from