Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
61518868
Commit
61518868
authored
May 30, 2012
by
Phill Sparks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generated URLs default to use the current protocol (http or https)
Signed-off-by:
Phill Sparks
<
phill@bulbstudios.com
>
parent
d21713f3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
17 deletions
+16
-17
form.php
laravel/form.php
+2
-2
helpers.php
laravel/helpers.php
+2
-2
html.php
laravel/html.php
+1
-1
redirect.php
laravel/redirect.php
+2
-2
router.php
laravel/routing/router.php
+1
-1
url.php
laravel/url.php
+8
-9
No files found.
laravel/form.php
View file @
61518868
...
...
@@ -51,7 +51,7 @@ class Form {
* @param bool $https
* @return string
*/
public
static
function
open
(
$action
=
null
,
$method
=
'POST'
,
$attributes
=
array
(),
$https
=
false
)
public
static
function
open
(
$action
=
null
,
$method
=
'POST'
,
$attributes
=
array
(),
$https
=
null
)
{
$method
=
strtoupper
(
$method
);
...
...
@@ -129,7 +129,7 @@ class Form {
* @param bool $https
* @return string
*/
public
static
function
open_for_files
(
$action
=
null
,
$method
=
'POST'
,
$attributes
=
array
(),
$https
=
false
)
public
static
function
open_for_files
(
$action
=
null
,
$method
=
'POST'
,
$attributes
=
array
(),
$https
=
null
)
{
$attributes
[
'enctype'
]
=
'multipart/form-data'
;
...
...
laravel/helpers.php
View file @
61518868
...
...
@@ -323,7 +323,7 @@ function head($array)
* @param bool $https
* @return string
*/
function
url
(
$url
=
''
,
$https
=
false
)
function
url
(
$url
=
''
,
$https
=
null
)
{
return
Laravel\URL
::
to
(
$url
,
$https
);
}
...
...
@@ -335,7 +335,7 @@ function url($url = '', $https = false)
* @param bool $https
* @return string
*/
function
asset
(
$url
,
$https
=
false
)
function
asset
(
$url
,
$https
=
null
)
{
return
Laravel\URL
::
to_asset
(
$url
,
$https
);
}
...
...
laravel/html.php
View file @
61518868
...
...
@@ -124,7 +124,7 @@ class HTML {
* @param bool $https
* @return string
*/
public
static
function
link
(
$url
,
$title
,
$attributes
=
array
(),
$https
=
false
)
public
static
function
link
(
$url
,
$title
,
$attributes
=
array
(),
$https
=
null
)
{
$url
=
URL
::
to
(
$url
,
$https
);
...
...
laravel/redirect.php
View file @
61518868
...
...
@@ -9,7 +9,7 @@ class Redirect extends Response {
* @param bool $secure
* @return Redirect
*/
public
static
function
home
(
$status
=
302
,
$https
=
false
)
public
static
function
home
(
$status
=
302
,
$https
=
null
)
{
return
static
::
to
(
URL
::
home
(
$https
),
$status
);
}
...
...
@@ -41,7 +41,7 @@ class Redirect extends Response {
* @param bool $https
* @return Redirect
*/
public
static
function
to
(
$url
,
$status
=
302
,
$https
=
false
)
public
static
function
to
(
$url
,
$status
=
302
,
$https
=
null
)
{
return
static
::
make
(
''
,
$status
)
->
header
(
'Location'
,
URL
::
to
(
$url
,
$https
));
}
...
...
laravel/routing/router.php
View file @
61518868
...
...
@@ -297,7 +297,7 @@ class Router {
* @param bool $https
* @return void
*/
public
static
function
controller
(
$controllers
,
$defaults
=
'index'
,
$https
=
false
)
public
static
function
controller
(
$controllers
,
$defaults
=
'index'
,
$https
=
null
)
{
foreach
((
array
)
$controllers
as
$identifier
)
{
...
...
laravel/url.php
View file @
61518868
...
...
@@ -35,7 +35,7 @@ class URL {
* @param bool $https
* @return string
*/
public
static
function
home
(
$https
=
false
)
public
static
function
home
(
$https
=
null
)
{
$route
=
Router
::
find
(
'home'
);
...
...
@@ -91,7 +91,7 @@ class URL {
* @param bool $https
* @return string
*/
public
static
function
to
(
$url
=
''
,
$https
=
false
)
public
static
function
to
(
$url
=
''
,
$https
=
null
)
{
// If the given URL is already valid or begins with a hash, we'll just return
// the URL unchanged since it is already well formed. Otherwise we will add
...
...
@@ -101,6 +101,10 @@ class URL {
return
$url
;
}
// Unless $https is specified (true or false) then maintain the current request
// security for any new links generated. So https for all secure links.
if
(
is_null
(
$https
))
$https
=
Request
::
secure
();
$root
=
static
::
base
()
.
'/'
.
Config
::
get
(
'application.index'
);
// Since SSL is not often used while developing the application, we allow the
...
...
@@ -174,7 +178,7 @@ class URL {
*/
protected
static
function
explicit
(
$route
,
$action
,
$parameters
)
{
$https
=
array_get
(
current
(
$route
),
'https'
,
false
);
$https
=
array_get
(
current
(
$route
),
'https'
,
null
);
return
static
::
to
(
static
::
transpose
(
key
(
$route
),
$parameters
),
$https
);
}
...
...
@@ -197,8 +201,6 @@ class URL {
// URIs that begin with that string and no others.
$root
=
$bundle
[
'handles'
]
?:
''
;
$https
=
false
;
$parameters
=
implode
(
'/'
,
$parameters
);
// We'll replace both dots and @ signs in the URI since both are used
...
...
@@ -230,8 +232,6 @@ class URL {
return
rtrim
(
$root
,
'/'
)
.
'/'
.
ltrim
(
$url
,
'/'
);
}
if
(
is_null
(
$https
))
$https
=
Request
::
secure
();
$url
=
static
::
to
(
$url
,
$https
);
// Since assets are not served by Laravel, we do not need to come through
...
...
@@ -258,7 +258,6 @@ class URL {
*
* @param string $name
* @param array $parameters
* @param bool $https
* @return string
*/
public
static
function
to_route
(
$name
,
$parameters
=
array
())
...
...
@@ -271,7 +270,7 @@ class URL {
// To determine whether the URL should be HTTPS or not, we look for the "https"
// value on the route action array. The route has control over whether the URL
// should be generated with an HTTPS protocol string or just HTTP.
$https
=
array_get
(
current
(
$route
),
'https'
,
false
);
$https
=
array_get
(
current
(
$route
),
'https'
,
null
);
$uri
=
trim
(
static
::
transpose
(
key
(
$route
),
$parameters
),
'/'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment