Skip to content

Commit 0556ef3

Browse files
committed
Merge branch 'develop' of github.com:laravel/laravel into develop
2 parents 30175c2 + dab2c79 commit 0556ef3

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

laravel/html.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,12 @@ public static function span($value, $attributes = array())
137137
* @param bool $https
138138
* @return string
139139
*/
140-
public static function link($url, $title, $attributes = array(), $https = null)
140+
public static function link($url, $title = null, $attributes = array(), $https = null)
141141
{
142142
$url = URL::to($url, $https);
143143

144+
if (is_null($title)) $title = $url;
145+
144146
return '<a href="'.$url.'"'.static::attributes($attributes).'>'.static::entities($title).'</a>';
145147
}
146148

@@ -152,7 +154,7 @@ public static function link($url, $title, $attributes = array(), $https = null)
152154
* @param array $attributes
153155
* @return string
154156
*/
155-
public static function link_to_secure($url, $title, $attributes = array())
157+
public static function link_to_secure($url, $title = null, $attributes = array())
156158
{
157159
return static::link($url, $title, $attributes, true);
158160
}
@@ -168,7 +170,7 @@ public static function link_to_secure($url, $title, $attributes = array())
168170
* @param bool $https
169171
* @return string
170172
*/
171-
public static function link_to_asset($url, $title, $attributes = array(), $https = null)
173+
public static function link_to_asset($url, $title = null, $attributes = array(), $https = null)
172174
{
173175
$url = URL::to_asset($url, $https);
174176

@@ -183,7 +185,7 @@ public static function link_to_asset($url, $title, $attributes = array(), $https
183185
* @param array $attributes
184186
* @return string
185187
*/
186-
public static function link_to_secure_asset($url, $title, $attributes = array())
188+
public static function link_to_secure_asset($url, $title = null, $attributes = array())
187189
{
188190
return static::link_to_asset($url, $title, $attributes, true);
189191
}
@@ -207,7 +209,7 @@ public static function link_to_secure_asset($url, $title, $attributes = array())
207209
* @param array $attributes
208210
* @return string
209211
*/
210-
public static function link_to_route($name, $title, $parameters = array(), $attributes = array())
212+
public static function link_to_route($name, $title = null, $parameters = array(), $attributes = array())
211213
{
212214
return static::link(URL::to_route($name, $parameters), $title, $attributes);
213215
}
@@ -231,7 +233,7 @@ public static function link_to_route($name, $title, $parameters = array(), $attr
231233
* @param array $attributes
232234
* @return string
233235
*/
234-
public static function link_to_action($action, $title, $parameters = array(), $attributes = array())
236+
public static function link_to_action($action, $title = null, $parameters = array(), $attributes = array())
235237
{
236238
return static::link(URL::to_action($action, $parameters), $title, $attributes);
237239
}
@@ -418,7 +420,7 @@ public static function __callStatic($method, $parameters)
418420
{
419421
return call_user_func_array(static::$macros[$method], $parameters);
420422
}
421-
423+
422424
throw new \Exception("Method [$method] does not exist.");
423425
}
424426

laravel/profiling/profiler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Laravel\Event;
66
use Laravel\Config;
77
use Laravel\Request;
8+
use Laravel\Database;
89

910
class Profiler {
1011

@@ -57,6 +58,8 @@ public static function query($sql, $bindings, $time)
5758
{
5859
foreach ($bindings as $binding)
5960
{
61+
$binding = Database::connection()->pdo->quote($binding);
62+
6063
$sql = preg_replace('/\?/', $binding, $sql, 1);
6164
}
6265

laravel/request.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,16 @@ public static function referrer()
177177
{
178178
return static::foundation()->headers->get('referer');
179179
}
180+
181+
/**
182+
* Get the timestamp of the time when the request was started.
183+
*
184+
* @return int
185+
*/
186+
public static function time()
187+
{
188+
return (int) LARAVEL_START;
189+
}
180190

181191
/**
182192
* Determine if the current request is via the command line.

0 commit comments

Comments
 (0)