
Originally Posted by
niccol
Yeah, but it is probably easier to change the module than change the auto-installer :-) You've got the line number form the errors
Code:
[04-Feb-2015 16:25:51 America/Chicago] PHP Warning: strstr(): Empty needle in /home/enignet/public_html/includes/classes/bmz_image_handler.class.php on line 129
You are probably going to do something like this
Code:
function determine_image_sizetype() {
global $ihConf;
if (strstr($this->src, $ihConf['large']['suffix'])) {
$this->sizetype = 'large';
} elseif (strstr($this->src, $ihConf['medium']['suffix'])) {
$this->sizetype = 'medium';
} elseif ((intval($this->width) == intval($ihConf['small']['width'])) && (intval($this->height) == intval($ihConf['small']['height']))) {
$this->sizetype = 'small';
} else
$this->sizetype = 'generic';
}
changed to:
Code:
function determine_image_sizetype() {
global $ihConf;
$this->sizetype = 'generic';
if($ihConf['large']['suffix'] != '')
{
if (strstr($this->src, $ihConf['large']['suffix'])) {
$this->sizetype = 'large';
}
}
if($ihConf['medium']['suffix'] != '')
{
if (strstr($this->src, $ihConf['medium']['suffix'])) {
$this->sizetype = 'medium';
}
}
if($ihConf['large']['small'] != '')
{
if (strstr($this->src, $ihConf['small']['suffix'])) {
$this->sizetype = 'small';
}
}
}
Off the top of my head and without looking at any of the other areas or consequences.
I would suggest either of the following two depending on the desired goal. First would be to prevent the error in this section of code, but wouldn't address similar potential problems later on, the second would set the variables in this section of code but also may still have the issue later, either way, an example to address the issue and maintain existing functionality. The example above appears to lead to all images being the size of the last defined size.
Code:
function determine_image_sizetype() {
global $ihConf;
if (zen_not_null($ihConf['large']['suffix']) && strstr($this->src, $ihConf['large']['suffix'])) {
$this->sizetype = 'large';
} elseif (zen_not_null($ihConf['medium']['suffix']) && strstr($this->src, $ihConf['medium']['suffix'])) {
$this->sizetype = 'medium';
} elseif ((intval($this->width) == intval($ihConf['small']['width'])) && (intval($this->height) == intval($ihConf['small']['height']))) {
$this->sizetype = 'small';
} else
$this->sizetype = 'generic';
}
Code:
function determine_image_sizetype() {
global $ihConf;
if (!zen_not_null($ihConf['large']['suffix']) {
$ihConf['large']['suffix'] = '_LRG';
}
if (!zen_not_null($ihConf['medium']['suffix']) {
$ihConf['medium']['suffix'] = '_MED';
}
if (strstr($this->src, $ihConf['large']['suffix'])) {
$this->sizetype = 'large';
} elseif (strstr($this->src, $ihConf['medium']['suffix'])) {
$this->sizetype = 'medium';
} elseif ((intval($this->width) == intval($ihConf['small']['width'])) && (intval($this->height) == intval($ihConf['small']['height']))) {
$this->sizetype = 'small';
} else
$this->sizetype = 'generic';
}
Bookmarks