Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #671 from nishizoe/t-4557
(fixed #4557, BP from #4288) プロフィールで『テキスト(複数行)』で『入力値タイプ』が『数値』『メールアドレス』『URL』の場合に改行コードを許容するように変更
- Loading branch information
Showing
4 changed files
with
132 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the OpenPNE package. | ||
* (c) OpenPNE Project (http://www.openpne.jp/) | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file and the NOTICE file that were distributed with this source code. | ||
*/ | ||
|
||
/** | ||
* opValidatorMultipleEmail validates emails. | ||
* | ||
* @package OpenPNE | ||
* @subpackage validator | ||
*/ | ||
class opValidatorMultipleEmail extends sfValidatorEmail | ||
{ | ||
protected function configure($options = array(), $messages = array()) | ||
{ | ||
parent::configure($options, $messages); | ||
} | ||
|
||
public function clean($value) | ||
{ | ||
$value = str_replace("\r\n", "\n", $value); | ||
$value = str_replace("\r", "\n", $value); | ||
$values = explode("\n", $value); | ||
foreach ($values as $v) | ||
{ | ||
parent::clean($v); | ||
} | ||
|
||
return $value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the OpenPNE package. | ||
* (c) OpenPNE Project (http://www.openpne.jp/) | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file and the NOTICE file that were distributed with this source code. | ||
*/ | ||
|
||
/** | ||
* opValidatorMultipleInteger validates an integer. | ||
* | ||
* @package OpenPNE | ||
* @subpackage validator | ||
*/ | ||
class opValidatorMultipleInteger extends sfValidatorInteger | ||
{ | ||
protected function configure($options = array(), $messages = array()) | ||
{ | ||
parent::configure($options, $messages); | ||
} | ||
|
||
public function clean($value) | ||
{ | ||
$value = str_replace("\r\n", "\n", $value); | ||
$value = str_replace("\r", "\n", $value); | ||
$values = explode("\n", $value); | ||
foreach ($values as $v) | ||
{ | ||
parent::clean($v); | ||
} | ||
|
||
return $value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the OpenPNE package. | ||
* (c) OpenPNE Project (http://www.openpne.jp/) | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file and the NOTICE file that were distributed with this source code. | ||
*/ | ||
|
||
/** | ||
* opValidatorMultipleEmail validates Urls. | ||
* | ||
* @package OpenPNE | ||
* @subpackage validator | ||
*/ | ||
class opValidatorMultipleUrl extends sfValidatorUrl | ||
{ | ||
protected function configure($options = array(), $messages = array()) | ||
{ | ||
parent::configure($options, $messages); | ||
} | ||
|
||
public function clean($value) | ||
{ | ||
$value = str_replace("\r\n", "\n", $value); | ||
$value = str_replace("\r", "\n", $value); | ||
$values = explode("\n", $value); | ||
foreach ($values as $v) | ||
{ | ||
parent::clean($v); | ||
} | ||
|
||
return $value; | ||
} | ||
} |