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

spotzero’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)