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

Guard clause for getMultiple in cache.inc

$
0
0

Problem/Motivation

In the method getMultiple, includes/cache.inc there is no guard clause for check if $cids is empty.
Some contrib modules doesn't validate if are requesting cache from empty items.
What is the real problem? For empty cids, Drupal will execute this query:
SELECT cid, data, created, expire, serialized FROM cache WHERE cid IN ()
This will throw an exception, but in database:
SQL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1

Proposed resolution

I've attached a patch, but just for cache.inc. Imho, we should review to apply that to every getMultiple method.


Viewing all articles
Browse latest Browse all 292987

Trending Articles



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