Skip to content

Commit 434e3ca

Browse files
committed
Restore no extension RewriteRule
c7cd618 contained a regression bug where #75 fix was un-do. This fixes it, usign the code created to fix #75 Also, this commit creates temporary version 2.0.1. Release will go under 2.1.0
1 parent 7700bc2 commit 434e3ca

3 files changed

Lines changed: 27 additions & 1 deletion

File tree

extension.driver.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,25 @@ public function update($previousVersion = false)
168168
throw new Exception($message);
169169
}
170170
}
171+
172+
if (version_compare($previousVersion, '2.0.0', '<')) {
173+
try {
174+
// Re-simplify JIT htaccess rule
175+
// see c7cd6183ffd15b9a8b7864df2eb29d3c1d96b5f9
176+
if ($htaccess->exists()) {
177+
$htaccess->simplifyJITAccessRule();
178+
}
179+
} catch (Exception $ex) {
180+
$message = __(
181+
'An error occured while updating %s. %s',
182+
array(
183+
__('JIT Image Manipulation'),
184+
$ex->getMessage()
185+
)
186+
);
187+
throw new Exception($message);
188+
}
189+
}
171190
}
172191

173192
public function uninstall()

extension.meta.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@
1616
</author>
1717
</authors>
1818
<releases>
19+
<release version="2.0.1" date="TBA" min="2.6.0" max="2.x.x">
20+
- Refactored all filters to eliminate duplicated code
21+
- Fixed a couple of bugs (#120, #121)
22+
- Fixed a regression in the .htaccess rule, where the file extension was added to the RewriteRule.
23+
- Restored HTTP headers and cache
24+
</release>
1925
<release version="2.0.0" date="2016-04-26" min="2.6.0" max="2.x.x">
2026
- JIT image process is it's own Symphony renderer now
2127
- PSR2 Compliance (for the most part)

lib/class.htaccess.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function enableExtension()
6161

6262
$rule = "
6363
### IMAGE RULES
64-
RewriteRule ^image\/(.+\.(jpg|gif|jpeg|png|bmp))$ index.php?mode=jit&param={$token} [B,L,NC]" . PHP_EOL . PHP_EOL;
64+
RewriteRule ^image\/(.+)$ index.php?mode=jit&param={$token} [B,L,NC]" . PHP_EOL . PHP_EOL;
6565

6666
if (preg_match('/### IMAGE RULES/', $this->content)) {
6767
$this->content = preg_replace(
@@ -107,6 +107,7 @@ public function disableExtension()
107107

108108
/**
109109
* Update from < 1.21
110+
* Update from < 2.0.0
110111
*/
111112
public function simplifyJITAccessRule()
112113
{

0 commit comments

Comments
 (0)