Put regex rules between single quotes
This commit is contained in:
parent
d52c6184b9
commit
f05c228f1d
7 changed files with 16 additions and 16 deletions
|
@ -913,7 +913,7 @@ class Application_Model_Preference
|
|||
|
||||
public static function SetLatestVersion($version)
|
||||
{
|
||||
$pattern = "/^[0-9]+\.[0-9]+\.[0-9]+/";
|
||||
$pattern = '/^[0-9]+\.[0-9]+\.[0-9]+/';
|
||||
if (preg_match($pattern, $version)) {
|
||||
self::setValue('latest_version', $version);
|
||||
}
|
||||
|
@ -932,8 +932,8 @@ class Application_Model_Preference
|
|||
public static function SetLatestLink($link)
|
||||
{
|
||||
$pattern = '#^(http|https|ftp)://' .
|
||||
"([a-zA-Z0-9]+\.)*[a-zA-Z0-9]+" .
|
||||
"(/[a-zA-Z0-9\-\.\_\~\:\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=]+)*/?$#";
|
||||
'([a-zA-Z0-9]+\.)*[a-zA-Z0-9]+' .
|
||||
'(/[a-zA-Z0-9\-\.\_\~\:\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=]+)*/?$#';
|
||||
if (preg_match($pattern, $link)) {
|
||||
self::setValue('latest_link', $link);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue