Skip to content

Commit

Permalink
Fixing a RegEx for windows users who use Image Placeholders.
Browse files Browse the repository at this point in the history
  • Loading branch information
meenie committed Oct 17, 2013
1 parent b83c399 commit 1291d3b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Munee/Asset/Type/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ protected function parsePlaceholders($file)

foreach ($this->options['placeholders'] as $path => $placeholder) {
// Setup path for regex
$regex = '^' . $this->request->webroot . str_replace(array('*', $this->request->webroot), array('.*?', ''), $path) . '$';
$escapedWebroot = preg_quote($this->request->webroot);
$regex = '^' . $escapedWebroot . str_replace(array('*', $this->request->webroot), array('.*?', ''), $path) . '$';
if (preg_match("%{$regex}%", $file)) {
if ('http' == substr($placeholder, 0, 4)) {
$ret = $this->getImageByUrl($placeholder);
Expand Down

0 comments on commit 1291d3b

Please sign in to comment.