#513 WebGui don't save the ampersand character ( & )

v0.69x
closed
Volker
WebGUI (143)
5
2012-10-28
2009-02-23
Freddy Krueger
No

In System|Advanced|Command Scripts, when you save a command line that has the ampersand character (&), the character will not be saved.

ex : /mnt/system/mysql/bin/mysqld_safe &

when you try to add the above command line, it will save : /mnt/system/mysql/bin/mysqld_safe

Discussion

  • Volker
    Volker
    2009-02-24

    I knew that problem but did not have any idea how to solve that. The HTML special chars like " and & are converted to " and & before the configuration is stored. So there is currently no problem when you enter such a char in the WebGUI. The problem comes when the config.xml file is loaded because the PHP XML parser seems to filter such things.

    The handler to processes character data is set like this:
    xml_set_character_data_handler($xml_parser, "cdata");

    Now it seems that the callback handler filters some characters because if the data is <xxx>test & "</xxx> the callback function cdata is called with 'test ' as data. So there is no chance for me to fix this problem right at the moment.

    Maybe someone else has any idea.

    I tried to fix the " problem some days ago but it seems now to be useless when i re-think about it.
    See http://freenas.svn.sourceforge.net/viewvc/freenas/branches/0.69/etc/inc/xmlparse.inc?revision=4376&view=markup

    Regards
    Volker

     
  • Volker
    Volker
    2009-02-27

    I think PHP 5.2.9 solves the problem. Check the PR http://bugs.php.net/bug.php?id=45996

    Regards
    Volker