8000 Merge pull request #570 from AoSiX/urlencode_issue · allforweb/laravel@8e05530 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8e05530

Browse files
committed
Merge pull request laravel#570 from AoSiX/urlencode_issue
Change htmlentities to urlencode for link
2 parents af42dec + 8eae68b commit 8e05530

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

laravel/html.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static function decode($value)
6262
*/
6363
public static function script($url, $attributes = array())
6464
{
65-
$url = static::entities(URL::to_asset($url));
65+
$url = urlencode(URL::to_asset($url));
6666

6767
return '<script src="'.$url.'"'.static::attributes($attributes).'></script>'.PHP_EOL;
6868
}
@@ -90,7 +90,7 @@ public static function style($url, $attributes = array())
9090

9191
$attributes = $attributes + $defaults;
9292

93-
$url = static::entities(URL::to_asset($url));
93+
$url = urlencode(URL::to_asset($url));
9494

9595
return '<link href="'.$url.'"'.static::attributes($attributes).'>'.PHP_EOL;
9696
}
@@ -126,7 +126,7 @@ public static function span($value, $attributes = array())
126126
*/
127127
public static function link($url, $title, $attributes = array(), $https = false)
128128
{
129-
$url = static::entities(URL::to($url, $https));
129+
$url = urlencode(URL::to($url, $https));
130130

131131
return '<a href="'.$url.'"'.static::attributes($attributes).'>'.static::entities($title).'</a>';
132132
}
@@ -157,7 +157,7 @@ public static function link_to_secure($url, $title, $attributes = array())
157157
*/
158158
public static function link_to_asset($url, $title, $attributes = array(), $https = null)
159159
{
160-
$url = static::entities(URL::to_asset($url, $https));
160+
$url = urlencode(URL::to_asset($url, $https));
161161

162162
return '<a href="'.$url.'"'.static::attributes($attributes).'>'.static::entities($title).'</a>';
163163
}
@@ -267,7 +267,7 @@ public static function image($url, $alt = '', $attributes = array())
267267
{
268268
$attributes['alt'] = $alt;
269269

270-
return '<img src="'.static::entities(URL::to_asset($url)).'"'.static::attributes($attributes).'>';
270+
return '<img src="'.urlencode(URL::to_asset($url)).'"'.static::attributes($attributes).'>';
271271
}
272272

273273
/**

0 commit comments

Comments
 (0)
0