Commit 18807c9c authored by kiz_0987's avatar kiz_0987
Browse files

Make checking for a valid gallery install more robust (do not just trust the...

Make checking for a valid gallery install more robust (do not just trust the gallery_valid variable, but always do an isreadable check as well -- avoid case of a moved drupal/g2 installation causing PHP errors).
parent 5ca0c573
...@@ -29,7 +29,7 @@ function _gallery_init($full = false, $vars = null) { ...@@ -29,7 +29,7 @@ function _gallery_init($full = false, $vars = null) {
$gallery_valid = $vars['gallery_valid']; $gallery_valid = $vars['gallery_valid'];
} }
if (!$gallery_valid) { if ((!$gallery_valid) || (!is_readable($embedPath))) {
// It's probably now bad practice to return a null here, given that $ret=null is a gallery2 // It's probably now bad practice to return a null here, given that $ret=null is a gallery2
// success response // success response
return array(false, null); return array(false, null);
...@@ -190,7 +190,7 @@ function gallery_error($message, $ret) { ...@@ -190,7 +190,7 @@ function gallery_error($message, $ret) {
if (isset($ret)) { if (isset($ret)) {
$full_message = $message . '<br/>' . $ret->getAsHtml(); $full_message = $message . '<br/>' . $ret->getAsHtml();
} else { } else {
$full_message = $message; $full_message = $message;
} }
......
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