@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * |
131 | 131 | * @return string |
132 | 132 | */ |
133 | - protected function _getCustomIncludeFilename($position='') { |
|
133 | + protected function _getCustomIncludeFilename($position = '') { |
|
134 | 134 | $key = 'custom_include_file'; |
135 | 135 | $key .= ($position) ? '_'.$position : ''; |
136 | 136 | return $this->_formatTemplate( |
@@ -146,10 +146,10 @@ discard block |
||
146 | 146 | */ |
147 | 147 | protected function _getCustomCookieHash() { |
148 | 148 | $keys = Mage::getStoreConfig('turpentine_vcl/cookie/keys'); |
149 | - if(!empty($keys)){ |
|
149 | + if ( ! empty($keys)) { |
|
150 | 150 | $tpl = ''; |
151 | 151 | $keys = Mage::helper('turpentine/data')->cleanExplode(PHP_EOL, $keys); |
152 | - foreach($keys as $key){ |
|
152 | + foreach ($keys as $key) { |
|
153 | 153 | $tpl .= 'if (req.http.Cookie ~ "'.$key.'=") {'.PHP_EOL; |
154 | 154 | $tpl .= 'hash_data(regsub(req.http.Cookie, "^.*?'.$key.'=([^;]*);*.*$", "\1"));'.PHP_EOL; |
155 | 155 | $tpl .= '}'.PHP_EOL; |
@@ -213,8 +213,8 @@ discard block |
||
213 | 213 | */ |
214 | 214 | protected function _getAdminFrontname() { |
215 | 215 | if (Mage::getStoreConfig('admin/url/use_custom_path')) { |
216 | - if(Mage::getStoreConfig('web/url/use_store')) { |
|
217 | - return Mage::getModel('core/store')->load(0)->getCode() . "/" . Mage::getStoreConfig('admin/url/custom_path'); |
|
216 | + if (Mage::getStoreConfig('web/url/use_store')) { |
|
217 | + return Mage::getModel('core/store')->load(0)->getCode()."/".Mage::getStoreConfig('admin/url/custom_path'); |
|
218 | 218 | } else { |
219 | 219 | return Mage::getStoreConfig('admin/url/custom_path'); |
220 | 220 | } |
@@ -928,8 +928,8 @@ discard block |
||
928 | 928 | */ |
929 | 929 | protected function _vcl_sub_https_redirect_fix() { |
930 | 930 | $baseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); |
931 | - $baseUrl = str_replace(array('http://','https://'), '', $baseUrl); |
|
932 | - $baseUrl = rtrim($baseUrl,'/'); |
|
931 | + $baseUrl = str_replace(array('http://', 'https://'), '', $baseUrl); |
|
932 | + $baseUrl = rtrim($baseUrl, '/'); |
|
933 | 933 | |
934 | 934 | $tpl = <<<EOS |
935 | 935 | if ( (req.http.host ~ "^(?i)www.$baseUrl" || req.http.host ~ "^(?i)$baseUrl") && req.http.X-Forwarded-Proto !~ "(?i)https") { |
@@ -1064,7 +1064,7 @@ discard block |
||
1064 | 1064 | $vars['https_redirect'] = $this->_vcl_sub_https_redirect_fix(); |
1065 | 1065 | } |
1066 | 1066 | |
1067 | - foreach (array('','top') as $position) { |
|
1067 | + foreach (array('', 'top') as $position) { |
|
1068 | 1068 | $customIncludeFile = $this->_getCustomIncludeFilename($position); |
1069 | 1069 | if (is_readable($customIncludeFile)) { |
1070 | 1070 | $key = 'custom_vcl_include'; |