/** * Returns value with all tags removed. * * @param mixed $key * @return mixed * * @tag filter */ function noTags($key) { if (!$this->keyExists($key)) { return false; } return Inspekt::noTags($this->_getValue($key)); }
/** * */ public function testNoTags() { $input = '<SCRIPT>alert(\'foobar\');</SCRIPT>'; $expect = 'alert(\'foobar\');'; $this->assertSame($expect, Inspekt::noTags($input)); }
$d['lowascii'] = ' '; $d[] = array('foo', 'bar<br />', 'yes<P>', 1776); $d['x']['woot'] = array('booyah' => 'meet at the bar at 7:30 pm', 'ultimate' => '<strong>hi there!</strong>'); $d['lemon'][][][][][][][][][][][][][][] = 'far'; ?> <h2>A crazy, crazy array ($d)</h2> <?php echo "<pre>"; echo var_dump($d); echo "</pre>\n"; ?> <h2>Inspekt::noTags($d)</h2> <?php $newd = Inspekt::noTags($d); echo "<pre>"; echo var_dump($newd); echo "</pre>\n"; ?> <h2>Inspekt::noTagsOrSpecial($d)</h2> <?php $newd = Inspekt::noTagsOrSpecial($d); echo "<pre>"; echo var_dump($newd); echo "</pre>\n"; ?>
$message = ""; $footer = ""; if (isset($_GET["title"])) { $title = $_GET["title"]; } if (isset($_GET["alert"])) { $message = $_GET["alert"]; } if (isset($_GET["footer"])) { $footer = $_GET["footer"]; } $alert_modal_id = "alert"; $alert_modal_content = "<p id='alert-paragraph'>" . Inspekt::noTags($message) . "</p>"; // $alert_modal_content = '<img src="http://maps.googleapis.com/maps/api/staticmap?center=56.1138608,10.1577942&zoom=13&size=300x300&sensor=false">'; $alert_modal_title = Inspekt::noTags($title); $alert_modal_footer = Inspekt::noTags($footer); // get the modal DocElement::modal($alert_modal_id, $alert_modal_title, $alert_modal_content, $alert_modal_footer); ?> <script src="lib/plugins/jquery.viewport.mini.js"></script> <script src="lib/plugins/jquery.event.drag-2.2/jquery.event.drag-2.2.js"></script> <script src="lib/js/javascript.js"></script> <script src="lib/js/form-elements.js"></script> <script src="lib/js/smart-search.js"></script> <script src="lib/js/jquery.easing.1.3.js"></script> <script src="lib/js/top-ads.js"></script> <script src="lib/js/expanded-view.js"></script> <script src="lib/js/sticky.js"></script> <script src="lib/js/upload-multiple-images.js"></script>
/** * Descricao : Limpa as tags que um dado possa conter * * @param Field field : Um objeto field * */ private function cleanTagsValidation($field) { if ($field->getMethod() == "get") { $_GET[$field->getName()] = Inspekt::noTags($_GET[$field->getName()]); } else { $_POST[$field->getName()] = Inspekt::noTags($_POST[$field->getName()]); } return true; }
/** * Returns value with all tags removed. * * @param mixed $key * @return mixed * @throws Exception * @tag filter */ public function noTags($key) { return Inspekt::noTags($this->getValue($key)); }