Skip to content

Commit

Permalink
make subfolders in web path possible (#166)
Browse files Browse the repository at this point in the history
* make subfolders in web path possible
fixes #142

* replace Backslashes

* Versionsnummer und Kommentar

---------

Co-authored-by: christophboecker <[email protected]>
  • Loading branch information
tyrant88 and christophboecker authored Dec 7, 2024
1 parent 0eefcbe commit e047afe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/asset_packer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* AssetPacker - Support für REDAXO-Addons.
*
* @author Christoph Böcker <https://github.com/christophboecker/>
* @version 1.3.5
* @version 1.3.6
* @copyright Christoph Böcker
* @license Die AssetPacker-Klassen: MIT-License <https://opensource.org/licenses/MIT>
* Die JS-Minifier-Klasse: BSD 3-Clause License <https://github.com/tedivm/JShrink/blob/master/LICENSE>
Expand Down Expand Up @@ -470,7 +470,7 @@ public function getTag(string $media = 'all'): string
{
// Pathname relativ zu rex_path
// für Windows: \ in / ändern
$asset = str_replace('\\', '/', rex_path::relative($this->target));
$asset = str_replace('\\', '/', rex_path::relative($this->target, rex_path::frontend()));
$asset = rex_url::base($asset);

if (!rex::isDebugMode() && rex::isBackend() && $this->timestamp) {
Expand Down Expand Up @@ -502,7 +502,9 @@ public function minify(string $content = ''): string
public function getTag(array $options = []): string
{
// Pathname relativ zu rex_path
$asset = rex_url::base(rex_path::relative($this->target));
// für Windows: \ in / ändern
$asset = str_replace('\\', '/', rex_path::relative($this->target, rex_path::frontend()));
$asset = rex_url::base($asset);

if (array_key_exists(rex_view::JS_IMMUTABLE, $options) && $options[rex_view::JS_IMMUTABLE]) {
if (!rex::isDebugMode() && rex::isBackend() && $this->timestamp) {
Expand Down

0 comments on commit e047afe

Please sign in to comment.