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
92694da3
Commit
92694da3
authored
Nov 01, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring.
parent
997a90bc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
5 deletions
+20
-5
response.php
laravel/response.php
+4
-4
url.php
laravel/url.php
+16
-1
No files found.
laravel/response.php
View file @
92694da3
...
...
@@ -243,10 +243,10 @@ class Response {
/**
* Send all of the response headers to the browser.
*
* The develop
may set any response headers they wish using the "header" method.
*
All of the headers set by the developer will be automatically sent to the
*
browser when the response is sent via the "send" method. There is no need
* t
o call t
his method before calling the "send" method.
* The develop
er may set response headers using the "header" method. All of
*
the headers set by the developer will be automatically sent to the browser
*
when the response is sent via the "send" method. There is no need to call
* this method before calling the "send" method.
*
* The protocol and status header will be set automatically, as well as the
* content-type and charset, unless those headers have been set explicitly.
...
...
laravel/url.php
View file @
92694da3
...
...
@@ -20,14 +20,29 @@ class URL {
{
if
(
filter_var
(
$url
,
FILTER_VALIDATE_URL
)
!==
false
)
return
$url
;
return
rtrim
(
static
::
root
(
$https
),
'/'
)
.
'/'
.
ltrim
(
$url
,
'/'
);
}
/**
* Get the URL to the root of the application.
*
* @param bool $https
* @return string
*/
protected
static
function
root
(
$https
=
false
)
{
$base
=
Config
::
$items
[
'application'
][
'url'
]
.
'/'
.
Config
::
$items
[
'application'
][
'index'
];
// It is possible for the developer to totally disable the generation of links
// that use HTTPS. This is primarily to create a convenient test environment
// when using SSL is not an option. We will only replace the first occurence
// of "http" with "https" since URLs are sometimes passed in query strings.
if
(
$https
and
Config
::
$items
[
'application'
][
'ssl'
])
{
$base
=
preg_replace
(
'~http://~'
,
'https://'
,
$base
,
1
);
}
return
rtrim
(
$base
,
'/'
)
.
'/'
.
ltrim
(
$url
,
'/'
)
;
return
$base
;
}
/**
...
...
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