Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
6a9cc481
Commit
6a9cc481
authored
Apr 02, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix handling of hash Urls.
parent
c0a80d13
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletions
+20
-1
changes.md
+1
-0
laravel/url.php
+19
-1
No files found.
changes.md
View file @
6a9cc481
...
...
@@ -24,6 +24,7 @@
-
Added "$hidden" static variable to the base Eloquent model.
-
Added "sync" method to has_many_and_belongs_to Eloquent relationship.
-
Improved View performance by only loading contents from file once.
-
Fix handling of URLs beginning with has in URL::to.
<a
name=
"upgrade-3.2"
></a>
## Upgrading From 3.1
...
...
laravel/url.php
View file @
6a9cc481
...
...
@@ -117,7 +117,13 @@ class URL {
*/
public
static
function
to
(
$url
=
''
,
$https
=
false
)
{
if
(
filter_var
(
$url
,
FILTER_VALIDATE_URL
)
!==
false
)
return
$url
;
// 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
// the base URL of the application and return the full URL.
if
(
static
::
valid
(
$url
)
or
starts_with
(
$url
,
'#'
))
{
return
$url
;
}
$root
=
static
::
base
()
.
'/'
.
Config
::
get
(
'application.index'
);
...
...
@@ -310,4 +316,15 @@ class URL {
return
trim
(
$uri
,
'/'
);
}
/**
* Determine if the given URL is valid.
*
* @param string $url
* @return bool
*/
public
static
function
valid
(
$url
)
{
return
filter_var
(
$url
,
FILTER_VALIDATE_URL
)
!==
false
;
}
}
\ No newline at end of file
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