Changeset 7495
- Timestamp:
- May 29, 2008, 8:16:52 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OpenPNE/branches/stable-2.12.x/webapp/lib/util/util.php
r7326 r7495 854 854 } 855 855 856 function util_output_xml4array($data, $root )856 function util_output_xml4array($data, $root, $ignore_escape_list = array()) 857 857 { 858 858 require_once 'XML/Serializer.php'; … … 862 862 $serializer = new XML_Serializer($option); 863 863 864 $data = util_escape4output_xml($data, $ignore_escape_list); 865 864 866 $result = $serializer->serialize($data); 865 867 … … 872 874 873 875 util_send_header_internal_server_error(); 876 } 877 878 function util_escape4output_xml($data, $ignore_keys = array()) 879 { 880 if (is_array($data)) { 881 foreach ($data as $key => $value) { 882 if (in_array($key, $ignore_keys)) { 883 $data[$key] = $value; 884 } else { 885 $data[$key] = util_escape4output_xml($value); 886 } 887 } 888 } 889 890 if (is_string($data)) { 891 return htmlspecialchars($data, ENT_QUOTES, 'UTF-8'); 892 } 893 894 return $data; 874 895 } 875 896
Note: See TracChangeset
for help on using the changeset viewer.