Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refining local combo loader image path replacements

  • Loading branch information...
commit 21ee6ff0f6476e3fdb3818828f90b640b989649d 1 parent a623901
@cauld cauld authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 phploader/combo.php
View
9 phploader/combo.php
@@ -111,21 +111,20 @@
$crtResourceContent = $loader->getRemoteContent($key);
//Handle image path corrections (order is important)
- $crtResourceContent = preg_replace('/((url\()(\w+)(.*);)/', '${2}'. $crtResourceBase . '${3}${4}', $crtResourceContent); // subdirs (e.g) url(foo/foo.png)
- $crtResourceContent = preg_replace('/(url\([^\.\/]\))+/', $crtResourceBase, $crtResourceContent); // just filename (e.g.) url(picker_mask.png)
+ $crtResourceContent = preg_replace('/((url\()([^\.\.|^http]\S+)(\)))/', '${2}'. $crtResourceBase . '${3}${4}', $crtResourceContent); // just filename or subdirs/filename (e.g) url(foo.png), url(foo/foo.png)
$crtResourceContent = str_replace("url(/", "url($crtResourceBase", $crtResourceContent); // slash filename (e.g.) url(/whatever)
- $crtResourceContent = preg_replace('/(\.\.\/)+/', $crtResourceBase, $crtResourceContent); // relative pathes (e.g.) url(../../foo.png)
+ $crtResourceContent = preg_replace('/(url\()(\.\.\/)+/', 'url(' . $base, $crtResourceContent); // relative paths (e.g.) url(../../foo.png)
$crtResourceContent = preg_replace_callback(
'/AlphaImageLoader\(src=[\'"](.*?)[\'"]/',
'alphaImageLoaderPathCorrection',
$crtResourceContent
- ); // AlphaImageLoader relative pathes (e.g.) AlphaImageLoader(src='../../foo.png')
+ ); // AlphaImageLoader relative paths (e.g.) AlphaImageLoader(src='../../foo.png')
$rawCSS .= $crtResourceContent;
}
}
- //Cleanup build path dups caused by relative pathes that already included the build directory
+ //Cleanup build path dups caused by relative paths that already included the build directory
$rawCSS = str_replace("/build/build/", "/build/", $rawCSS);
if (APC_AVAIL === true) {
Please sign in to comment.
Something went wrong with that request. Please try again.