Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-29085

String conversion in eZXMLOutputHandler->NodeArray is pointless

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Documentation Review done
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 5.3.12, 5.4.11, 2017.12
    • Fix Version/s: None
    • Labels:
      None

      Description

      Seems like nodeID is forced to convert to string at https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/classes/datatypes/ezxmltext/ezxmloutputhandler.php#L278 and https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/classes/datatypes/ezxmltext/ezxmloutputhandler.php#L285

      But http://php.net/manual/en/language.types.array.php says:
      Additionally the following key casts will occur:
      Strings containing valid decimal integers, unless the number is preceded by a + sign, will be cast to the integer type. E.g. the key "8" will actually be stored under 8. On the other hand "08" will not be cast, as it isn't a valid decimal integer.

      I.e. the string conversion is pointless, the array index will be an integer anyway.

      PR: https://github.com/ezsystems/ezpublish-legacy/pull/1356

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            gunnstein.lye@ez.no Gunnstein Lye
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: