Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Xml_safe_fieldname

    Scheduled Pinned Locked Moved Development
    3 Posts 2 Posters 1.1k Views
    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.
    • BBcan177B
      BBcan177 Moderator
      last edited by

      In the following function, is there a reason why '_' is listed as a non-xml safe character?

      /etc/inc/util.inc

      /* return a fieldname that is safe for xml usage /
      function xml_safe_fieldname($fieldname) {
              $replace = array('/', '-', ' ', '!', '@', '#', '$', '%', '^', '&', '
      ', '(', ')',
                              '_', '+', '=', '{', '}', '[', ']', '|', '/', '<', '>', '?',
                              ':', ',', '.', ''', '\'
                      );
              return strtolower(str_replace($replace, "", $fieldname));
      }

      "Experience is something you don't get until just after you need it."

      Website: http://pfBlockerNG.com
      Twitter: @BBcan177  #pfBlockerNG
      Reddit: https://www.reddit.com/r/pfBlockerNG/new/

      1 Reply Last reply Reply Quote 0
      • BBcan177B
        BBcan177 Moderator
        last edited by

        Bump

        "Experience is something you don't get until just after you need it."

        Website: http://pfBlockerNG.com
        Twitter: @BBcan177  #pfBlockerNG
        Reddit: https://www.reddit.com/r/pfBlockerNG/new/

        1 Reply Last reply Reply Quote 0
        • D
          doktornotor Banned
          last edited by

          The reason is to confuse the enemy… :D As I understand it, this is only used for package name itself?

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.