note 104273 added to function.filter-var

From: Date: Sun, 05 Jun 2011 01:09:06 +0000
Subject: note 104273 added to function.filter-var
Groups: php.notes 
Request: Send a blank email to php-notes+get-180266@lists.php.net to get a copy of this message
And ... if you also want to handle pre-encoded multi-byte international URL's, you can include the additional code here: <?php // convert multi-byte international url's by stripping multi-byte chars $uri = urldecode($uri) . ' '; $len = mb_strlen($uri); if ($len !== strlen($uri)) { $convmap = array(0x0, 0x2FFFF, 0, 0xFFFF); $uri = mb_decode_numericentity($uri, $convmap, 'UTF-8'); } $uri = trim($uri); // now, process pre-encoded MBI's $regex = '#&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);#i'; $uri_test = preg_replace($regex, '$1', htmlentities($uri, ENT_QUOTES, 'UTF-8')); if ($uri_test != '') {$uri = $uri_test;} ?> ---- Server IP: 69.147.83.197 Probable Submitter: 173.93.172.237 ---- Manual Page -- http://www.php.net/manual/en/function.filter-var.php Edit -- https://master.php.net/note/edit/104273 Del: integrated -- https://master.php.net/note/delete/104273/integrated Del: useless -- https://master.php.net/note/delete/104273/useless Del: bad code -- https://master.php.net/note/delete/104273/bad+code Del: spam -- https://master.php.net/note/delete/104273/spam Del: non-english -- https://master.php.net/note/delete/104273/non-english Del: in docs -- https://master.php.net/note/delete/104273/in+docs Del: other reasons-- https://master.php.net/note/delete/104273 Reject -- https://master.php.net/note/reject/104273 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#180266) next »