summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt2
-rw-r--r--includes/common.inc5
2 files changed, 4 insertions, 3 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index f23b9c993..ed1dd62bd 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,6 +1,8 @@
Drupal 7.40, xxxx-xx-xx (development version)
-----------------------
+- Made Drupal's code for parsing .info files run much faster and use much less
+ memory.
- Prevented drupal_http_request() from returning an error when it receives a
201 through 206 HTTP status code.
- Added support for autoloading traits via the registry on sites running PHP
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.