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AK7ۛux@rM0ep4X  P´L$!&U6cvY4j{a=_r)TrE1Ƃ!WD>LYCP*gp1[*5;Ϳt%3-BojkXG`?x%JZߙV<OGYcY.T ޴ٕ֤6*i$m%cd-C?`N:|blTkdy24?DQ)BH(!0#"< |NNTNS`ݹyG Y1 t wFqŹV$ L f!n-CnnoZ*G: ާeD‰62n®*2xn9])8:7Jl=[o ( `#62_22v[Zn@2[ǣP?m0]OGwGk Lؖ>0S'꥾,p}SE_woÊKk!=ܴI\DqQڿ0?PV6;s(a%jzWň&k&֋dX!aVTڿ0?PHgv߀[]3y%c!~TZS%e @t|Z4DxlV>$~:)y>]Fivk[^-ū`,!txa:@ 97Z7JY9s'gϏčWZL&ǤG(RGMOCd+y>n?v]|[Z@Ғ~N4ì+ĭuKۼ)^TY8`XGصGڲs\kۉB3(}&]cqU}2? ooH:PL'تm5icAB/TPȣ[v& OҵF@q|Jo Djil_L, *R_U1fm5h񝚒qJfsϛܝ%Q.&a^ܼѝdk"t8f۵RO}"aMZIA%gQVr|Roe҂v|B&_4Yf٥GMb/Q؁N˺ѽ\a˫%p:I}lk< [y\U㓃dJ/vP5(\EDjmWRъp'IQm^DpY%hU2jq6'HM]'#q2T3_6xE\K bD ]-e񊽂d}1ypu{WXO.8dKQbPƑ}aC6OY0wSĚz>qCdjڃn@IT,{.΂hz*gp1[*5;Ϳt%3-}JD! 6v;E֮]y&JَxU/ZŊ)nxÛb.+0O"%d  S brective is defined. * @param HTMLPurifier_ConfigSchema_Interchange_Directive $d */ public function validateDirectiveAllowed($d) { if (is_null($d->allowed)) { return; } $this->with($d, 'allowed') ->assertNotEmpty() ->assertIsLookup(); // handled by InterchangeBuilder if (is_string($d->default) && !isset($d->allowed[$d->default])) { $this->error('default', 'must be an allowed value'); } $this->context[] = 'allowed'; foreach ($d->allowed as $val => $x) { if (!is_string($val)) { $this->error("value $val", 'must be a string'); } } array_pop($this->context); } /** * Extra validation if $valueAliases member variable of * HTMLPurifier_ConfigSchema_Interchange_Directive is defined. * @param HTMLPurifier_ConfigSchema_Interchange_Directive $d */ public function validateDirectiveValueAliases($d) { if (is_null($d->valueAliases)) { return; } $this->with($d, 'valueAliases') ->assertIsArray(); // handled by InterchangeBuilder $this->context[] = 'valueAliases'; foreach ($d->valueAliases as $alias => $real) { if (!is_string($alias)) { $this->error("alias $alias", 'must be a string'); } if (!is_string($real)) { $this->error("alias target $real from alias '$alias'", 'must be a string'); } if ($alias === $real) { $this->error("alias '$alias'", "must not be an alias to itself"); } } if (!is_null($d->allowed)) { foreach ($d->valueAliases as $alias => $real) { if (isset($d->allowed[$alias])) { $this->error("alias '$alias'", 'must not be an allowed value'); } elseif (!isset($d->allowed[$real])) { $this->error("alias '$alias'", 'must be an alias to an allowed value'); } } } array_pop($this->context); } /** * Extra validation if $aliases member variable of * HTMLPurifier_ConfigSchema_Interchange_Directive is defined. * @param HTMLPurifier_ConfigSchema_Interchange_Directive $d */ public function validateDirectiveAliases($d) { $this->with($d, 'aliases') ->assertIsArray(); // handled by InterchangeBuilder $this->context[] = 'aliases'; foreach ($d->aliases as $alias) { $this->validateId($alias); $s = $alias->toString(); if (isset($this->interchange->directives[$s])) { $this->error("alias '$s'", 'collides with another directive'); } if (isset($this->aliases[$s])) { $other_directive = $this->aliases[$s]; $this->error("alias '$s'", "collides with alias for directive '$other_directive'"); } $this->aliases[$s] = $d->id->toString(); } array_pop($this->context); } // protected helper functions /** * Convenience function for generating HTMLPurifier_ConfigSchema_ValidatorAtom * for validating simple member variables of objects. * @param $obj * @param $member * @return HTMLPurifier_ConfigSchema_ValidatorAtom */ protected function with($obj, $member) { return new HTMLPurifier_ConfigSchema_ValidatorAtom($this->getFormattedContext(), $obj, $member); } /** * Emits an error, providing helpful context. * @throws HTMLPurifier_ConfigSchema_Exception */ protected function error($target, $msg) { if ($target !== false) { $prefix = ucfirst($target) . ' in ' . $this->getFormattedContext(); } else { $prefix = ucfirst($this->getFormattedContext()); } throw new HTMLPurifier_ConfigSchema_Exception(trim($prefix . ' ' . $msg)); } /** * Returns a formatted context string. * @return string */ protected function getFormattedContext() { return implode(' in ', array_reverse($this->context)); } } // vim: et sw=4 sts=4