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

Improve checking for variable on fetch method, ezcontentobjecttreenode.php

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • None
    • 4.3.0
    • CI System
    • None
    • eZ Publish 4.3

    Description

      hi,

      kernel/classes/ezcontentobjecttreenode.php
      Line 3095

      </code>
      if ( count( $nodeListArray ) > 0 )
      </code>

      we somehow made it that nodelistarray was FALSE and a count on FALSE returns 1. it was joining the if clause even if nodelistarray was FALSE.

      additional you can add a check for the existance of the variable?

      patch could look like this:

      if ( is_array($nodeListArray) && count( $nodeListArray ) > 0 )
      or
      if ( $nodeListArray and count( $nodeListArray ) > 0 )

      Steps to reproduce

      <?php
      $testArr = FALSE;
      echo count($testArr);
      ?>

      Will output: 1

      Attachments

        Activity

          People

            ls ls
            unknown unknown
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: