Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
20 Jan 2012 at 02:59 UTC
Updated:
4 Jan 2014 at 01:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bleen commentedThis is a no-brainer ... patch applies fine.
As soon as testbot says ok, RTBC
Comment #2
amateescu commentedRTBC it is.
Comment #3
David_Rothstein commentedThis seems harmless, but the only thing it really bypasses in that case is a single call to preg_match()... Is it really worth statically caching that?
Comment #4
dries commentedI don't think it is worth caching, actually.
Comment #5
sunIn case of a positive preg_match(), further processing and calculations are executed. And those should be cached.
This is a mere Boolean static value, which has no weight at all in terms of memory.
Comment #6
David_Rothstein commentedBut a positive preg_match() only occurs for a valid simpletest request (which is already cached) or for someone trying to hack the site by pretending to be simpletest (which is pretty unlikely)... right?
That said, it definitely seems harmless in terms of memory usage.
Comment #8
catchI've gone ahead and committed this, since we're not adding any new static caching here, just fixing the existing one.
I'm not sure it's worth static caching this, so I opened #1436684: Remove static cache in drupal_valid_test_ua(), however there are an increasing number of patches in the queue trying to check this for bizarre simpletest edge cases, so I'd not want to remove it without discussing a bit more.
Comment #9
albert volkman commentedEasy D7 backport :)
Comment #10
sunComment #11
webchickCommitted and pushed to 7.x. Thanks!