Skip to content

Commit

Permalink
Merge pull request #818 from nexcess/devel
Browse files Browse the repository at this point in the history
Merge devel into master. Bump version to 0.6.3
  • Loading branch information
miguelbalparda committed Jun 23, 2015
2 parents c9a003a + c4e7c68 commit 94b59c9
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 70 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,3 +386,7 @@ Magento CE 1.8+ or EE 1.13+, see [these instructions](https://github.com/nexcess
* [#796] Ignore additional GET Parameters in Varnish Cache via Configuration (@thampe)
* [#626] Fix for dummy blocks not working (@jeroenvermeulen)
* [#719) Replace connect20/nexcessnet_turpentine package in composer.json (@ihor-sviziev)

### RELEASE-0.6.3
* [#499] Use rewrite instead of local Session model for form key handling (@eth8505)

53 changes: 53 additions & 0 deletions app/code/community/Nexcessnet/Turpentine/Model/Core/Session.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

/**
* Nexcess.net Turpentine Extension for Magento
* Copyright (C) 2012 Nexcess.net L.L.C.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
class Nexcessnet_Turpentine_Model_Core_Session extends Mage_Core_Model_Session
{
public function __construct($data=array())
{
$name = isset($data['name']) ? $data['name'] : null;
$this->init('core', $name);
}

/**
* Retrieve Session Form Key
*
* @return string A 16 bit unique key for forms
*/
public function getFormKey()
{
if (Mage::registry('replace_form_key') &&
!Mage::app()->getRequest()->getParam('form_key', false)) {
// flag request for ESI processing
Mage::register('turpentine_esi_flag', true, true);
return '{{form_key_esi_placeholder}}';
} else {
return parent::getFormKey();
}
}

public function real_getFormKey()
{
if (!$this->getData('_form_key')) {
$this->setData('_form_key', Mage::helper('core')->getRandomString(16));
}
return $this->getData('_form_key');
}
}
7 changes: 6 additions & 1 deletion app/code/community/Nexcessnet/Turpentine/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<config>
<modules>
<Nexcessnet_Turpentine>
<version>0.6.2</version>
<version>0.6.3</version>
</Nexcessnet_Turpentine>
</modules>
<default>
Expand Down Expand Up @@ -136,6 +136,11 @@
<turpentine>
<class>Nexcessnet_Turpentine_Model</class>
</turpentine>
<core>
<rewrite>
<session>Nexcessnet_Turpentine_Model_Core_Session</session>
</rewrite>
</core>
</models>
<cache>
<types>
Expand Down
69 changes: 0 additions & 69 deletions app/code/local/Mage/Core/Model/Session.php

This file was deleted.

0 comments on commit 94b59c9

Please sign in to comment.