fuel/fuel/core/classes/pagination.php
protected function _validate($name, $value)
	{
 		switch ($name)
		{
			case 'offset':
			case 'total_items':
				// make sure it's an integer
				if ($value != intval($value))
				{
					$value = 0;
				}
				// and that it's within bounds
				$value = max(0, $value);
			break;

			// integer or string
			case 'uri_segment':
				if (is_numeric($value))
				{
					// make sure it's an integer
					if ($value != intval($value))
					{
						$value = 1;
					}
					// and that it's within bounds
					$value = max(1, $value);
				}
			break;

			// validate integer values
			case 'current_page':
			case 'per_page':
			case 'limit':
			case 'total_pages':
			case 'num_links':
				// make sure it's an integer
				if ($value != intval($value))
				{
					$value = 1;
				}
				// and that it's within bounds
				$value = max(1, $value);
			break;

			// validate booleans
			case 'show_first':
			case 'show_last':
				if ( ! is_bool($value))
				{
					$value = (bool) $value;
				}
			break;

			// validate the link offset, and adjust if needed
			case 'link_offset':
				// make sure we have a fraction between 0 and 1
				if ($value > 1)
				{
					$value = $value / 100;
				}

				// and that it's within bounds
				$value = max(0.01, min($value, 0.99));
			break;
		}

		return $value;
	}
protected function _validate($name, $value)
	{
 		switch ($name)
		{
			case 'offset':
			case 'total_items':
				// make sure it's an integer
				if ($value != intval($value))
				{
					$value = 0;
				}
				// and that it's within bounds
				$value = max(0, $value);
			break;

			// integer or string
			case 'uri_segment':
				if (is_numeric($value))
				{
					// make sure it's an integer
					if ($value != intval($value))
					{
						$value = 1;
					}
					// and that it's within bounds
					$value = max(1, $value);
				}
			break;

			// validate integer values
			case 'current_page':
			case 'per_page':
			case 'limit':
			case 'total_pages':
			case 'num_links':
				// make sure it's an integer
				if ($value != intval($value))
				{
					$value = 1;
				}
				// and that it's within bounds
				$value = max(1, $value);
			break;

			// validate booleans
			case 'show_first':
			case 'show_last':
				if ( ! is_bool($value))
				{
					$value = (bool) $value;
				}
			break;

			// validate the link offset, and adjust if needed
			case 'link_offset':
				// make sure we have a fraction between 0 and 1
				if ($value > 1)
				{
					$value = $value / 100;
				}

				// and that it's within bounds
				$value = max(0.01, min($value, 0.99));
			break;
		}

		return $value;
	}
protected function _validate ( $ name , $ value ) { switch ( $ name ) { case 'offset' : case 'total_items' : // make sure it's an integer if ( $ value != intval ( $ value ) ) { $ value = 0 ; } // and that it's within bounds $ value = max ( 0 , $ value ) ; break ; // integer or string case 'uri_segment' : if ( is_numeric ( $ value ) ) { // make sure it's an integer if ( $ value != intval ( $ value ) ) { $ value = 1 ; } // and that it's within bounds $ value = max ( 1 , $ value ) ; } break ; // validate integer values case 'current_page' : case 'per_page' : case 'limit' : case 'total_pages' : case 'num_links' : // make sure it's an integer if ( $ value != intval ( $ value ) ) { $ value = 1 ; } // and that it's within bounds $ value = max ( 1 , $ value ) ; break ; // validate booleans case 'show_first' : case 'show_last' : if ( ! is_bool ( $ value ) ) { $ value = ( bool ) $ value ; } break ; // validate the link offset, and adjust if needed case 'link_offset' : // make sure we have a fraction between 0 and 1 if ( $ value > 1 ) { $ value = $ value / 100 ; } // and that it's within bounds $ value = max ( 0.01 , min ( $ value , 0.99 ) ) ; break ; } return $ value ; }
Validate the input configuration
Validate the input configuration