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.
A warning appear:
Strict warning: Only variables should be passed by reference in ais_image_style_deliver() (line 107 of ...\sites\all\modules\ais\ais.module).
basically the problem is in this line
$bypass = isset($style['name']) && _ais_is_used($style['name'], variable_get('ais_adaptive_styles', array()));
I solved changing this code:
if (!variable_get('image_allow_insecure_derivatives', FALSE) && defined('IMAGE_DERIVATIVE_TOKEN')) {
// First check that an adaptive style is being requested.
$bypass = isset($style['name']) && _ais_is_used($style['name'], variable_get('ais_adaptive_styles', array()));
// Next check that a valid token for the main adaptive style is present.
$bypass = $bypass && isset($_GET[IMAGE_DERIVATIVE_TOKEN]) && $_GET[IMAGE_DERIVATIVE_TOKEN] === image_style_path_token(AIS_ADAPTIVE_STYLE, $scheme . '://' . $target);
// If so, we can bypass the standard image_style_deliver() security check
// for this request.
if ($bypass) {
$bypass_granted = TRUE;
$GLOBALS['conf']['image_allow_insecure_derivatives'] = TRUE;
}
}
into this:
if (!variable_get('image_allow_insecure_derivatives', FALSE) && defined('IMAGE_DERIVATIVE_TOKEN')) {
// First check that an adaptive style is being requested.
$ais_adaptive_styles = variable_get('ais_adaptive_styles', array());
$bypass = isset($style['name']) && _ais_is_used($style['name'], $ais_adaptive_styles);
// Next check that a valid token for the main adaptive style is present.
$bypass = $bypass && isset($_GET[IMAGE_DERIVATIVE_TOKEN]) && $_GET[IMAGE_DERIVATIVE_TOKEN] === image_style_path_token(AIS_ADAPTIVE_STYLE, $scheme . '://' . $target);
// If so, we can bypass the standard image_style_deliver() security check
// for this request.
if ($bypass) {
$bypass_granted = TRUE;
$GLOBALS['conf']['image_allow_insecure_derivatives'] = TRUE;
}
}
Comments
Comment #1
spotzero CreditAttribution: spotzero commentedDuplicated of #1967688: Strict warning in ais.module