Commit 2faa6a51 authored by frjo's avatar frjo

Issue #1116672: Backport fix to handle ColorBox to Colorbox change to 1.x branch.

parent 1928da1b
......@@ -49,6 +49,8 @@ The Colorbox plugin:
Installation:
------------
1. Download and unpack the Colorbox plugin in "sites/all/libraries".
Make sure the path to the plugin file becomes:
"sites/all/libraries/colorbox/jquery.colorbox-min.js"
Link: https://github.com/jackmoore/colorbox/archive/1.x.zip
Drush users can use the command "drush colorbox-plugin".
2. Download and unpack the Colorbox module directory in your modules folder
......
......@@ -28,7 +28,7 @@ function colorbox_requirements($phase) {
'title' => $t('Colorbox plugin'),
'value' => $t('At least @a', array('@a' => COLORBOX_MIN_PLUGIN_VERSION)),
'severity' => REQUIREMENT_ERROR,
'description' => $t('You need to download the !colorbox and extract the entire contents of the archive into the %path folder of your server.', array('!colorbox' => l(t('Colorbox plugin'), 'http://colorpowered.com/colorbox/'), '%path' => $library_path)),
'description' => $t('You need to download the !colorbox and extract the entire contents of the archive into the %path folder of your server.', array('!colorbox' => l(t('Colorbox plugin'), 'https://github.com/jackmoore/colorbox/archive/1.x.zip'), '%path' => $library_path)),
);
}
}
......
......@@ -267,7 +267,7 @@ function _colorbox_doheader() {
*/
function colorbox_get_version($colorbox_js = NULL) {
$version = 0;
$pattern = '#ColorBox v([0-9\.a-z]+)#';
$pattern = '@(?i:Colorbox) v([0-9\.a-z]+)@';
// No file is passed in so use the default location.
if (is_null($colorbox_js)) {
......@@ -276,12 +276,11 @@ function colorbox_get_version($colorbox_js = NULL) {
// Return the version of Colorbox plugin, it it exists.
if (file_exists($colorbox_js)) {
$colorbox_plugin = file_get_contents($colorbox_js, NULL, NULL, 0, 32);
$colorbox_plugin = file_get_contents($colorbox_js, NULL, NULL, 0, 64);
if (preg_match($pattern, $colorbox_plugin, $matches)) {
$version = $matches[1];
}
}
return $version;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment