I'm tracking a very hidden bug right now, and the effect is that my node cache is getting corrupted. I think I found the problem, and it's in node_gallery. Even if this isn't my particular problem, the fix is beneficial to node_gallery.

At some point, the function node_gallery_gallery_to_arg was added to the module. There is an assumption within the function, that the $arg variable will always contain a node id. This is not the case. The value of $arg can, and often is, a percent sign. You can see this being addressed in the core function user_uid_optional_to_arg.

node_gallery_gallery_to_arg doesn't do any checking on this variable, and passes it to the node_load function. Instead, we should check to see if the argument is numeric, and return immediately if not. The attached patch will do just that.

CommentFileSizeAuthor
ng_gallery_to_arg.patch572 bytesjustintime
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kmonty’s picture

Status: Needs review » Fixed

Great catch. Fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.