Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm not sure if I'm missing something but it seems like the code for libraries_get_version isn't actually checking the entire file. This statement:
if (preg_match($options['pattern'], $line, $version)) {
is always going to return TRUE. If the last argument was omitted, then it would return a proper boolean.
It seems like the code isn't ever getting past the first line.
Comment | File | Size | Author |
---|
Comments
Comment #1
asherry CreditAttribution: asherry commentedThis patch changes the 3rd argument to $result, and checks for $result[1] every time. If that is not empty then we have a version, so we populate the $version variable.
We also don't want to return immediately because then fclose is never called.
This patch fixed that for me too.
Comment #2
asherry CreditAttribution: asherry commentedRemoving ownership, I just want to clarify this should be reviewed by a maintainer.
Comment #3
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 5 year old patch to libraries.module applied cleanly to the latest libraries 7.x-2.x-dev and if still applicable needs review.