Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 301029

GDToolkit::load() wrongly calls GDToolkit::isValid()

$
0
0

GDToolkit::getResource() checks GDToolkit::$resource is a resource; if it's not, it calls GDToolkit::load(), which first calls GDToolkit::isValid(), which checks that either GDToolkit::$preloadInfo or GDToolkit::$resource has been set.

GDToolkit::load() should not call GDToolkit::isValid(). GDToolkit::load() is a protected method called to initialize GDToolkit::$resource; checking if GDToolkit::$resource has been set and return FALSE if it was not doesn't make sense. The method should check if GDToolkit::$preloadInfo has been set, which means that GDToolkit::parseFile() has returned TRUE (i.e., the file whose filename is set with GDToolkit::setSource() contains an image).

GDToolkit::isValid() doesn't return FALSE simply because the Image constructor calls GDToolkit::parseFile() after calling GDToolkit::setSource(); still checking the value of GDToolkit::$resource twice doesn't make sense.


Viewing all articles
Browse latest Browse all 301029

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>