diff options
author | David Rothstein <drothstein@gmail.com> | 2015-10-13 01:01:46 -0400 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2015-10-13 01:01:46 -0400 |
commit | ff246ebcc9b67f7a47ad52529ae81a60a3269305 (patch) | |
tree | 01dc82863f51fa3ff88a958826c62a4fce23caf0 /includes | |
parent | d3e02219e85bc9335aef13ad7cb668025a7cba11 (diff) | |
download | brdo-ff246ebcc9b67f7a47ad52529ae81a60a3269305.tar.gz brdo-ff246ebcc9b67f7a47ad52529ae81a60a3269305.tar.bz2 |
Issue #2146643 by quicksketch: Speed up drupal_parse_info_format() 3x and reduce memory 95%
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/includes/common.inc b/includes/common.inc index ab763bad7..e5e8150dc 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -7468,7 +7468,6 @@ function drupal_parse_info_file($filename) { */ function drupal_parse_info_format($data) { $info = array(); - $constants = get_defined_constants(); if (preg_match_all(' @^\s* # Start at the beginning of a line, ignoring leading whitespace @@ -7508,8 +7507,8 @@ function drupal_parse_info_format($data) { } // Handle PHP constants. - if (isset($constants[$value])) { - $value = $constants[$value]; + if (preg_match('/^\w+$/i', $value) && defined($value)) { + $value = constant($value); } // Insert actual value. |