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
52091bda
Commit
52091bda
authored
Mar 21, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added "match" validation rule for regular expression checks.
parent
afb33c17
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
validation.php
application/language/en/validation.php
+1
-0
validator.php
laravel/validator.php
+12
-0
No files found.
application/language/en/validation.php
View file @
52091bda
...
@@ -36,6 +36,7 @@ return array(
...
@@ -36,6 +36,7 @@ return array(
"in"
=>
"The selected :attribute is invalid."
,
"in"
=>
"The selected :attribute is invalid."
,
"integer"
=>
"The :attribute must be an integer."
,
"integer"
=>
"The :attribute must be an integer."
,
"ip"
=>
"The :attribute must be a valid IP address."
,
"ip"
=>
"The :attribute must be a valid IP address."
,
"match"
=>
"The :attribute format is invalid."
,
"max"
=>
array
(
"max"
=>
array
(
"numeric"
=>
"The :attribute must be less than :max."
,
"numeric"
=>
"The :attribute must be less than :max."
,
"file"
=>
"The :attribute must be less than :max kilobytes."
,
"file"
=>
"The :attribute must be less than :max kilobytes."
,
...
...
laravel/validator.php
View file @
52091bda
...
@@ -611,6 +611,18 @@ class Validator {
...
@@ -611,6 +611,18 @@ class Validator {
return
preg_match
(
'/^([-a-z0-9_-])+$/i'
,
$value
);
return
preg_match
(
'/^([-a-z0-9_-])+$/i'
,
$value
);
}
}
/**
* Validate that an attribute passes a regular expression check.
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
protected
function
validate_match
(
$attribute
,
$value
,
$parameters
)
{
return
preg_match
(
$parameters
[
0
],
$value
);
}
/**
/**
* Validate the MIME type of a file upload attribute is in a set of MIME types.
* Validate the MIME type of a file upload attribute is in a set of MIME types.
*
*
...
...
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