Config Settings Long/Short Form Inconsistency



  • Why are config settings inconsistently saved in long form / short form?

    Sometimes when comparing config files some entries will be in long form and other times in short form.

    A few examples from <openvpn-server>section

    Long Form

    
    <ipaddr></ipaddr>
    
    <passtos></passtos>
    
    

    Short Form

    
     <ipaddr><crlref><passtos></passtos></crlref></ipaddr> 
    ```</openvpn-server>

  • Rebel Alliance Developer Netgate

    I have seen that on occasion but haven't tried tracking it down. It must be something in the way the values are being saved by the XML parser, though it isn't clear what the specific difference is in this case.

    We're looking into it now, though: https://redmine.pfsense.org/issues/6893



  • Thanks Jim.  Hope it gets figured out.  It would make doing diff compares cleaner.

    Note: In the example I gave it was the section that was being changed that ended up with long form empty tags.  IDK maybe that's a clue.


  • Rebel Alliance Developer Netgate

    From what we've seen so far, it's a quirk on how PHP interprets the different values of empty(), zero, null, "", and ''. It's looking like we could force everything to use long tags easier than we could fix it to use short tags, but it's not clear yet if it's worth the extra effort either way.



  • I'm not sure that hold with what I observed.  I've not comprehensively tested it out though.

    I don't really care if it's long or short form but having it be consistent would be helpful.


  • Developer Netgate

    Pushed a change to force <tag></tag>rather than <tag>This should make the config file more consistent.</tag>


Log in to reply