This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
phptsmadmin/application/classes/Valid.php

28 lines
732 B
PHP
Raw Normal View History

2011-05-23 10:01:27 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* Array and variable validation.
*
* @package lnApp/Modifications
* @category Classes
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
*/
2012-11-26 05:57:18 +00:00
abstract class Valid extends Kohana_Valid {
2011-05-23 10:01:27 +00:00
/**
* Checks if a field matches the value of another field, if it is set.
* Field is ignored if it is blank.
*
* @param array array of values
* @param string field name
* @param string field name to match
* @return boolean
*/
public static function matches_ifset($array, $field, $match)
2012-11-26 05:57:18 +00:00
{
2011-05-23 10:01:27 +00:00
return isset($array[$match]) ? ($array[$field] === $array[$match]) : TRUE;
}
}
?>