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

eZDOMDocument::elementsByName does not always return an array

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 3.8.3
    • Misc
    • None
    • Version: 3.8.3
      PHP Version:
      Webserver:
      Database:

    Description

          function &elementsByName( $name )
          {
              return $this->NamedNodes[$name];
          }
      

      What if there were no elements with the name $name? This would be better:

          function &elementsByName( $name )
          {
              $return = array();
              if ( array_key_exists( $name, $this->NamedNodes ) )
              {
                  $return =& $this->NamedNodes[$name];
              }
      
              return $return;
          }
      

      Attachments

        Activity

          People

            vp vp
            cyberwolf cyberwolf
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: