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
53e8f9b7
Commit
53e8f9b7
authored
Apr 10, 2012
by
Keith Loy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing bug where custom validation messages in bundle language files were not getting picked up.
parent
b7ac1b75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
validator.php
laravel/validator.php
+8
-8
No files found.
laravel/validator.php
View file @
53e8f9b7
...
@@ -559,7 +559,7 @@ class Validator {
...
@@ -559,7 +559,7 @@ class Validator {
protected
function
validate_active_url
(
$attribute
,
$value
)
protected
function
validate_active_url
(
$attribute
,
$value
)
{
{
$url
=
str_replace
(
array
(
'http://'
,
'https://'
,
'ftp://'
),
''
,
Str
::
lower
(
$value
));
$url
=
str_replace
(
array
(
'http://'
,
'https://'
,
'ftp://'
),
''
,
Str
::
lower
(
$value
));
return
checkdnsrr
(
$url
);
return
checkdnsrr
(
$url
);
}
}
...
@@ -608,7 +608,7 @@ class Validator {
...
@@ -608,7 +608,7 @@ class Validator {
*/
*/
protected
function
validate_alpha_dash
(
$attribute
,
$value
)
protected
function
validate_alpha_dash
(
$attribute
,
$value
)
{
{
return
preg_match
(
'/^([-a-z0-9_-])+$/i'
,
$value
);
return
preg_match
(
'/^([-a-z0-9_-])+$/i'
,
$value
);
}
}
/**
/**
...
@@ -657,7 +657,7 @@ class Validator {
...
@@ -657,7 +657,7 @@ class Validator {
protected
function
validate_before
(
$attribute
,
$value
,
$parameters
)
protected
function
validate_before
(
$attribute
,
$value
,
$parameters
)
{
{
return
(
strtotime
(
$value
)
<
strtotime
(
$parameters
[
0
]));
return
(
strtotime
(
$value
)
<
strtotime
(
$parameters
[
0
]));
}
}
/**
/**
* Validate the date is after a given date.
* Validate the date is after a given date.
...
@@ -670,7 +670,7 @@ class Validator {
...
@@ -670,7 +670,7 @@ class Validator {
protected
function
validate_after
(
$attribute
,
$value
,
$parameters
)
protected
function
validate_after
(
$attribute
,
$value
,
$parameters
)
{
{
return
(
strtotime
(
$value
)
>
strtotime
(
$parameters
[
0
]));
return
(
strtotime
(
$value
)
>
strtotime
(
$parameters
[
0
]));
}
}
/**
/**
* Get the proper error message for an attribute and rule.
* Get the proper error message for an attribute and rule.
...
@@ -692,7 +692,7 @@ class Validator {
...
@@ -692,7 +692,7 @@ class Validator {
{
{
return
$this
->
messages
[
$custom
];
return
$this
->
messages
[
$custom
];
}
}
elseif
(
Lang
::
has
(
$custom
=
"validation.custom.
{
$custom
}
"
,
$this
->
language
))
elseif
(
Lang
::
has
(
$custom
=
"
{
$bundle
}
validation.custom.
{
$custom
}
"
,
$this
->
language
))
{
{
return
Lang
::
line
(
$custom
)
->
get
(
$this
->
language
);
return
Lang
::
line
(
$custom
)
->
get
(
$this
->
language
);
}
}
...
@@ -753,7 +753,7 @@ class Validator {
...
@@ -753,7 +753,7 @@ class Validator {
$line
=
'string'
;
$line
=
'string'
;
}
}
return
Lang
::
line
(
"
{
$bundle
}
validation.
{
$rule
}
.
{
$line
}
"
)
->
get
(
$this
->
language
);
return
Lang
::
line
(
"
{
$bundle
}
validation.
{
$rule
}
.
{
$line
}
"
)
->
get
(
$this
->
language
);
}
}
/**
/**
...
@@ -929,7 +929,7 @@ class Validator {
...
@@ -929,7 +929,7 @@ class Validator {
protected
function
replace_after
(
$message
,
$attribute
,
$rule
,
$parameters
)
protected
function
replace_after
(
$message
,
$attribute
,
$rule
,
$parameters
)
{
{
return
str_replace
(
':date'
,
$parameters
[
0
],
$message
);
return
str_replace
(
':date'
,
$parameters
[
0
],
$message
);
}
}
/**
/**
* Get the displayable name for a given attribute.
* Get the displayable name for a given attribute.
...
@@ -988,7 +988,7 @@ class Validator {
...
@@ -988,7 +988,7 @@ class Validator {
{
{
$parameters
=
array
();
$parameters
=
array
();
// The format for specifying validation rules and parameters follows a
// The format for specifying validation rules and parameters follows a
// {rule}:{parameters} formatting convention. For instance, the rule
// {rule}:{parameters} formatting convention. For instance, the rule
// "max:3" specifies that the value may only be 3 characters long.
// "max:3" specifies that the value may only be 3 characters long.
if
((
$colon
=
strpos
(
$rule
,
':'
))
!==
false
)
if
((
$colon
=
strpos
(
$rule
,
':'
))
!==
false
)
...
...
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