Source for file Pixels.php
Documentation is available at Pixels.php
* Validates an integer representation of pixels according to the HTML spec.
public function validate($string, $config, $context) {
if ($string ===
'0') return $string;
if ($string ===
'') return false;
if (substr($string, $length -
2) ==
'px') {
$string =
substr($string, 0, $length -
2);
if ($int <
0) return '0';
// upper-bound value, extremely high values can
// crash operating systems, see <http://ha.ckers.org/imagecrash.html>
// WARNING, above link WILL crash you if you're using Windows
if ($this->max !==
null &&
$int >
$this->max) return (string)
$this->max;
public function make($string) {
if ($string ===
'') $max =
null;
else $max = (int)
$string;
Documentation generated on Thu, 19 Jun 2008 18:50:12 -0400 by phpDocumentor 1.4.2