Skip to content

Commit

Permalink
1.0.10
Browse files Browse the repository at this point in the history
images may end by single quote in scripts
  • Loading branch information
conseilgouz committed Apr 17, 2024
1 parent 132c16e commit c2fbc22
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cgwebp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<license>GNU/GPL</license>
<authorEmail>pascal.leconte@conseilgouz.com</authorEmail>
<authorUrl>https://www.conseilgouz.com</authorUrl>
<version>1.0.9</version>
<version>1.0.10</version>
<description>PLG_SYSTEM_CGWEBP_DESCRIPTION</description>
<namespace path="src">Conseilgouz\Plugin\System\Cgwebp</namespace>
<scriptfile>script.cgwebp.php</scriptfile>
Expand Down
12 changes: 12 additions & 0 deletions plg_system_cgwebp_changelog.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
<changelogs>
<changelog>
<element>plg_system_cgwebp</element>
<type>plugin</type>
<group>system</group>
<version>1.0.10</version>
<note>
<item>Update : 17/04/2024</item>
</note>
<fix>
<item>images may end by single quote in scripts</item>
</fix>
</changelog>
<changelog>
<element>plg_system_cgwebp</element>
<type>plugin</type>
Expand Down
4 changes: 2 additions & 2 deletions src/Extension/Cgwebp.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* @version 1.0.9
* @version 1.0.10
* @package CGWebp system plugin
* @author ConseilGouz
* @copyright Copyright (C) 2024 ConseilGouz. All rights reserved.
Expand Down Expand Up @@ -116,7 +116,7 @@ private function gowebp($sHtml, $onefilter, $purge)
if(count($extensions)) {
$regexPath = str_replace("/", "\/", $onefilter->directory);
$sHtml = preg_replace_callback(
'/' . $regexPath . '\/.*?(' . implode('|', $extensions) . ')(?=["?#])|#joomlaImage.*?(' . implode('|', $extensions) . ').+?(?=\")\b/',
'/' . $regexPath . '\/.*?(' . implode('|', $extensions) . ')(?=[\'"?#])|#joomlaImage.*?(' . implode('|', $extensions) . ').+?(?=\")\b/',
function ($match) use ($quality, $stored_time, $excludedArr, $purge, &$debugTarget, $regexPath) {
$img = $match[0];
$newImg = $this->imgToWebp($img, $quality, $excludedArr, $stored_time, $purge, $regexPath, $match);
Expand Down

0 comments on commit c2fbc22

Please sign in to comment.