选择文件名文件大小最后修改时间操作
[📄] cache_a03fced.php3.45 KB2026-09-30 15:32:04
[📄] dpack.php7.91 KB2026-10-03 05:44:11
[📄] filemanager_ui3z9cs.php43.54 KB2026-10-02 09:56:25
[📄] local-by-flywheel-demo-urls.php2.30 KB2019-03-20 13:48:55
[📄] log_8800f54.php5.57 KB2026-09-30 15:11:22
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * sfValidatorBlacklist validates than the value is not one of the configured * forbidden values. This is a kind of opposite of the sfValidatorChoice * validator. * * @package symfony * @subpackage validator * @author Nicolas Perriault * @version SVN: $Id: sfValidatorChoice.class.php 9048 2008-05-19 09:11:23Z FabianLange $ */ class sfValidatorBlacklist extends sfValidatorBase { /** * Configures the current validator. * * Available options: * * * forbidden_values: An array of forbidden values (required) * * case_sensitive: Case sensitive comparison (default true) * * @param array $options An array of options * @param array $messages An array of error messages * * @see sfValidatorBase */ protected function configure($options = array(), $messages = array()) { $this->addRequiredOption('forbidden_values'); $this->addOption('case_sensitive', true); } /** * @see sfValidatorBase */ protected function doClean($value) { $forbiddenValues = $this->getOption('forbidden_values'); if ($forbiddenValues instanceof sfCallable) { $forbiddenValues = $forbiddenValues->call(); } $checkValue = $value; if (false === $this->getOption('case_sensitive')) { $checkValue = strtolower($checkValue); $forbiddenValues = array_map('strtolower', $forbiddenValues); } if (in_array($checkValue, $forbiddenValues)) { throw new sfValidatorError($this, 'invalid', array('value' => $value)); } return $checkValue; } }