Skip to content

Commit

Permalink
Cleaner asset_resized_encode
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdekruijk committed Apr 28, 2021
1 parent ee66ea5 commit f125302
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
* @param bool|null $secure
* @return string
*/
function asset_resized($template, $path, $secure = null)
function asset_resized($template, $path, $secure = null, $encode = false)
{
if ($path) {
if ($encode) {
$path = str_replace('%2F', '/', rawurlencode($path));
}
return asset(config('imageresize.route') . '/' . $template . '/' . $path, $secure);
}
}
Expand All @@ -28,9 +31,6 @@ function asset_resized($template, $path, $secure = null)
*/
function asset_resized_encode($template, $path, $secure = null)
{
if ($path) {
$path = str_replace('%2F', '/', rawurlencode($path));
return asset(config('imageresize.route') . '/' . $template . '/' . $path, $secure);
}
return asset_resized($template, $path, $secure, true);
}
}

0 comments on commit f125302

Please sign in to comment.