PATH:
home
/
lab2454c
/
tripvare.com
/
vendor
/
ezyang
/
htmlpurifier
/
library
/
HTMLPurifier
/
AttrDef
/
CSS
<?php /** * Validates based on {ident} CSS grammar production */ class HTMLPurifier_AttrDef_CSS_Ident extends HTMLPurifier_AttrDef { /** * @param string $string * @param HTMLPurifier_Config $config * @param HTMLPurifier_Context $context * @return bool|string */ public function validate($string, $config, $context) { $string = trim($string); // early abort: '' and '0' (strings that convert to false) are invalid if (!$string) { return false; } $pattern = '/^(-?[A-Za-z_][A-Za-z_\-0-9]*)$/'; if (!preg_match($pattern, $string)) { return false; } return $string; } } // vim: et sw=4 sts=4
[-] TextDecoration.php
[edit]
[-] Filter.php
[edit]
[-] AlphaValue.php
[edit]
[+]
..
[-] Border.php
[edit]
[-] Color.php
[edit]
[-] Composite.php
[edit]
[-] Length.php
[edit]
[-] FontFamily.php
[edit]
[-] DenyElementDecorator.php
[edit]
[-] URI.php
[edit]
[-] Ident.php
[edit]
[-] Number.php
[edit]
[-] Background.php
[edit]
[-] Multiple.php
[edit]
[-] Font.php
[edit]
[-] ListStyle.php
[edit]
[-] Percentage.php
[edit]
[-] ImportantDecorator.php
[edit]
[-] BackgroundPosition.php
[edit]