1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-02 22:45:02 +03:00

Merge pull request #1 from intval/patch-1

improved func_htmlSpecialChars array walker
This commit is contained in:
Serg 2012-02-20 12:41:16 -08:00
commit 17986c992c

View file

@ -130,20 +130,20 @@ function func_generator($iLength=10) {
/**
* htmlspecialchars умеющая обрабатывать массивы
*
* @param unknown_type $data
* @param mixed $data
* @param int %walkIndex - represents the key/index of the array being recursively htmlspecialchars'ed
* @return void
*/
function func_htmlspecialchars(&$data) {
if (is_array($data)) {
foreach ($data as $sKey => $value) {
if (is_array($value)) {
func_htmlspecialchars($data[$sKey]);
} else {
$data[$sKey]=htmlspecialchars($value);
}
}
} else {
$data=htmlspecialchars($data);
function func_htmlspecialchars(&$data, $walkIndex = null)
{
if (!is_array($data))
{
$data = htmlspecialchars(&$data);
return;
}
array_walk($data, __FUNCTION__);
}
/**