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
7f465f30
Commit
7f465f30
authored
Jul 25, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactoring URL class.
parent
3c216d89
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
url.php
system/url.php
+6
-6
No files found.
system/url.php
View file @
7f465f30
...
...
@@ -9,9 +9,10 @@ class URL {
*
* @param string $url
* @param bool $https
* @param bool $asset
* @return string
*/
public
static
function
to
(
$url
=
''
,
$https
=
false
)
public
static
function
to
(
$url
=
''
,
$https
=
false
,
$asset
=
false
)
{
if
(
filter_var
(
$url
,
FILTER_VALIDATE_URL
)
!==
false
)
{
...
...
@@ -20,10 +21,9 @@ class URL {
$base
=
Config
::
get
(
'application.url'
)
.
'/'
.
Config
::
get
(
'application.index'
);
if
(
$https
and
strpos
(
$base
,
'http://'
)
===
0
)
{
$base
=
'https://'
.
substr
(
$base
,
7
);
}
$base
=
(
$asset
)
?
str_replace
(
'/'
.
Config
::
get
(
'application.index'
),
''
,
$base
)
:
$base
;
$base
=
(
$https
and
strpos
(
$base
,
'http://'
)
===
0
)
?
'https://'
.
substr
(
$base
,
7
)
:
$base
;
return
$base
.
'/'
.
ltrim
(
$url
,
'/'
);
}
...
...
@@ -48,7 +48,7 @@ class URL {
*/
public
static
function
to_asset
(
$url
)
{
return
st
r_replace
(
'/'
.
Config
::
get
(
'application.index'
),
''
,
static
::
to
(
$url
,
Request
::
is_secure
())
);
return
st
atic
::
to
(
$url
,
Request
::
is_secure
(),
true
);
}
/**
...
...
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