• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Snapin Characters replacement on textboxes

Scheduled Pinned Locked Moved Solved
Bug Reports
2
4
399
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E
    EduardoTSeoane
    last edited by EduardoTSeoane Sep 16, 2021, 2:04 AM Sep 16, 2021, 7:49 AM

    @Tom-Elliott @Sebastian-Roth

    When I add/remove storage groups, and modify the membership of a snapin, from snapins management page, the values on textbox are replaced changing special characters by html entities, for example where i have " is changed by " where I have " is replaced by "

    Verified on versions 1.5.6 and 1.5.9 clean installations.

    1 Reply Last reply Reply Quote 0
    • S
      Sebastian Roth Moderator
      last edited by Sep 16, 2021, 2:31 PM

      @EduardoTSeoane Please test on dev-branch as well and let us know.

      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

      E 1 Reply Last reply Sep 20, 2021, 8:07 AM Reply Quote 0
      • E
        EduardoTSeoane @Sebastian Roth
        last edited by Sep 20, 2021, 8:07 AM

        @sebastian-roth

        I update the server to dev-branch and and again, it happens.

        Editing Snapins:
        On Add/Remove/Update Storage Groups
        On Add/Remove hosts on Membership

        as a dirty temporal patch I add this code to solve it:

        $this->obj->set('description', htmlspecialchars_decode($this->obj->get('description')));
        $this->obj->set('name', htmlspecialchars_decode($this->obj->get('name')));
        $this->obj->set('args', htmlspecialchars_decode($this->obj->get('args')));
        $this->obj->set('hash', htmlspecialchars_decode($this->obj->get('hash')));
        $this->obj->set('runWith', htmlspecialchars_decode($this->obj->get('runWith')));
        $this->obj->set('runWithArgs', htmlspecialchars_decode($this->obj->get('runWithArgs')));
        $this->obj->set('timeout', htmlspecialchars_decode($this->obj->get('timeout')));
        

        On file /fog/lib/pages/snapinmanagementpage.class.php between lines 1653 and 1654.
        On file /fog/lib/fog/fogpage.class.php between lines lines 3604 and 3065

        1 Reply Last reply Reply Quote 1
        • S
          Sebastian Roth Moderator
          last edited by Sebastian Roth Nov 20, 2022, 2:23 PM Nov 20, 2022, 8:22 PM

          @EduardoTSeoane And another old one I came across. This one is still an issue. I have dug through a lot of code today to try and properly fix this. While there are different ways of getting this right I didn’t want to mess with too much of the code and introduce new problems. In case anyone comes across this, feel free to look into it again and see if there is a better way.

          • Remove general encoding of HTML special chars (in FOGBase class) and add it where needed instead. This would be a lot of places (e.g. 1) because HTML output is generated throughout the code - so re-working pretty much all of that. As well this would also change the output we get from the API for example. Currently HTML encoded for no good reason I think. But changing that could break things for people being used to it.
          • Another way would be to prevent the whole object from being saved in general when only associations should be set. This happens in many places as well (e.g. 2, 3). Same as above it would mean re-working a lot of the code. Although it’s probably worth it to reduce the amount of unnecessary changes being written to the database (improve performance a little).
          • So I chose the simplest route of all to just fix this for snapins in dev-branch (4). It’s not perfect but at least the actual issue is fixed for snapins where chars like " and > are used by people. FOG still messes up those characters in other places, e.g. host/image description.

          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post

          210

          Online

          12.0k

          Users

          17.3k

          Topics

          155.2k

          Posts
          Copyright © 2012-2024 FOG Project