From 6425567438cd2455314461e4158a91c229be9688 Mon Sep 17 00:00:00 2001 From: henoheno Date: Wed, 1 Nov 2006 23:45:25 +0900 Subject: [PATCH] Without flagment (#) --- spam.php | 21 +++++---------------- spam/spam.php | 21 +++++---------------- spam/spam_pickup.php | 16 +++++++++++++++- spam_pickup.php | 16 +++++++++++++++- 4 files changed, 40 insertions(+), 34 deletions(-) diff --git a/spam.php b/spam.php index f14058c..a4408b2 100644 --- a/spam.php +++ b/spam.php @@ -1,5 +1,5 @@ "\'\[\]/]+)*/+)?' .// 4: Directory path or path-info - '([^\s<>"\'\[\]]+)?' . // 5: Rest of all (File and query string) + '([^\s<>"\'\[\]\#]+)?' . // 5: Rest of all + // (File and query string, without flagment) '#i', $string, $array, PREG_SET_ORDER | PREG_OFFSET_CAPTURE); //var_dump(recursive_map('htmlspecialchars', $array)); @@ -105,19 +106,6 @@ function spam_pickup($string = '') } // $array[0] => $array['name'] -function array_rename_key(& $array, $from, $to, $force = FALSE, $default = '') -{ - if (isset($array[$from])) { - $array[$to] = & $array[$from]; - unset($array[$from]); - } else if ($force) { - $array[$to] = $default; - } else { - return FALSE; - } - return TRUE; -} - function array_rename_keys(& $array, $rename = array(), $force = FALSE, $default = '') { if ($force) { @@ -188,7 +176,8 @@ function area_measure($areas, &$array, $belief = -1, $a_key = 'area', $o_key = ' $areas_keys = array_keys($areas); foreach(array_keys($array) as $u_index) { - $offset = isset($array[$u_index][$o_key]) ? intval($array[$u_index][$o_key]) : 0; + $offset = isset($array[$u_index][$o_key]) ? + intval($array[$u_index][$o_key]) : 0; foreach($areas_keys as $a_index) { if (isset($array[$u_index][$a_key])) { $offset_s = intval($areas[$a_index][0]); diff --git a/spam/spam.php b/spam/spam.php index f14058c..a4408b2 100644 --- a/spam/spam.php +++ b/spam/spam.php @@ -1,5 +1,5 @@ "\'\[\]/]+)*/+)?' .// 4: Directory path or path-info - '([^\s<>"\'\[\]]+)?' . // 5: Rest of all (File and query string) + '([^\s<>"\'\[\]\#]+)?' . // 5: Rest of all + // (File and query string, without flagment) '#i', $string, $array, PREG_SET_ORDER | PREG_OFFSET_CAPTURE); //var_dump(recursive_map('htmlspecialchars', $array)); @@ -105,19 +106,6 @@ function spam_pickup($string = '') } // $array[0] => $array['name'] -function array_rename_key(& $array, $from, $to, $force = FALSE, $default = '') -{ - if (isset($array[$from])) { - $array[$to] = & $array[$from]; - unset($array[$from]); - } else if ($force) { - $array[$to] = $default; - } else { - return FALSE; - } - return TRUE; -} - function array_rename_keys(& $array, $rename = array(), $force = FALSE, $default = '') { if ($force) { @@ -188,7 +176,8 @@ function area_measure($areas, &$array, $belief = -1, $a_key = 'area', $o_key = ' $areas_keys = array_keys($areas); foreach(array_keys($array) as $u_index) { - $offset = isset($array[$u_index][$o_key]) ? intval($array[$u_index][$o_key]) : 0; + $offset = isset($array[$u_index][$o_key]) ? + intval($array[$u_index][$o_key]) : 0; foreach($areas_keys as $a_index) { if (isset($array[$u_index][$a_key])) { $offset_s = intval($areas[$a_index][0]); diff --git a/spam/spam_pickup.php b/spam/spam_pickup.php index 6aece8a..71d1350 100644 --- a/spam/spam_pickup.php +++ b/spam/spam_pickup.php @@ -1,5 +1,5 @@ $array['name'] +function array_rename_key(& $array, $from, $to, $force = FALSE, $default = '') +{ + if (isset($array[$from])) { + $array[$to] = & $array[$from]; + unset($array[$from]); + } else if ($force) { + $array[$to] = $default; + } else { + return FALSE; + } + return TRUE; +} + function show_form($string) { $base = basename(__FILE__); diff --git a/spam_pickup.php b/spam_pickup.php index 6aece8a..71d1350 100644 --- a/spam_pickup.php +++ b/spam_pickup.php @@ -1,5 +1,5 @@ $array['name'] +function array_rename_key(& $array, $from, $to, $force = FALSE, $default = '') +{ + if (isset($array[$from])) { + $array[$to] = & $array[$from]; + unset($array[$from]); + } else if ($force) { + $array[$to] = $default; + } else { + return FALSE; + } + return TRUE; +} + function show_form($string) { $base = basename(__FILE__); -- 2.11.0