Development

Changeset 24513

You must first sign up to be able to contribute.

Changeset 24513

Show
Ignore:
Timestamp:
11/29/09 00:34:54 (4 years ago)
Author:
FabianLange
Message:

[1.2, 1.3, 1.4] fixed vary cache key again (fixes #7605)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.2/lib/view/sfViewCacheManager.class.php

    r21979 r24513  
    170170        foreach ($varyHeaders as $header) 
    171171        { 
    172           $vary .= $request->getHttpHeader($header).'|'; 
     172          $vary .= $header . '_' . $request->getHttpHeader($header) . '_'; 
    173173        } 
    174174 
    175         $vary = $vary; 
     175        $vary = preg_replace('/[^a-z0-9]/i', '_', $vary); 
     176        $vary = preg_replace('/_+/', '_', $vary); 
    176177      } 
    177178      else 
  • branches/1.3/lib/view/sfViewCacheManager.class.php

    r23810 r24513  
    201201      foreach ($varyHeaders as $header) 
    202202      { 
    203         $value = $request->getHttpHeader($header); 
    204         $value = preg_replace('/[^a-z0-9\*]/i', '_', $value); 
    205         $value = preg_replace('/_+/', '_', $value); 
    206  
    207         $vary .= $value.'|'; 
     203        $vary .= $header . '_' . $request->getHttpHeader($header) . '_'; 
    208204      } 
     205 
     206      $vary = preg_replace('/[^a-z0-9]/i', '_', $vary); 
     207      $vary = preg_replace('/_+/', '_', $vary); 
    209208    } 
    210209 
  • branches/1.4/lib/view/sfViewCacheManager.class.php

    r23985 r24513  
    201201      foreach ($varyHeaders as $header) 
    202202      { 
    203         $value = $request->getHttpHeader($header); 
    204         $value = preg_replace('/[^a-z0-9\*]/i', '_', $value); 
    205         $value = preg_replace('/_+/', '_', $value); 
    206  
    207         $vary .= $value.'|'; 
     203        $vary .= $header . '_' . $request->getHttpHeader($header) . '_'; 
    208204      } 
     205 
     206      $vary = preg_replace('/[^a-z0-9]/i', '_', $vary); 
     207      $vary = preg_replace('/_+/', '_', $vary); 
    209208    } 
    210209 
     
    399398  /** 
    400399   * Returns true if the current content is cacheable. 
     400   * 
     401   * Possible break in backward compatibility: If the sf_lazy_cache_key 
     402   * setting is turned on in settings.yml, this method is not used when 
     403   * initially checking a partial's cacheability. 
    401404   * 
    402405   * @see sfPartialView, isActionCacheable()