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

String conversion in eZXMLOutputHandler->NodeArray is pointless

Details

    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

            Unassigned Unassigned
            gunnstein.lye@ibexa.co Gunnstein Lye
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: