Changeset 12752 for trunk/wp-admin/import/blogger.php
- Timestamp:
- 01/18/2010 08:34:48 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/import/blogger.php
r12270 r12752 782 782 // First line of headers is the HTTP response code 783 783 $http_response_line = array_shift($response_header_lines); 784 if (preg_match('@^HTTP/[0-9]\.[0-9] ([0-9]{3})@',$http_response_line, $matches)) { $response_code = $matches[1]; }784 if (preg_match('@^HTTP/[0-9]\.[0-9] ([0-9]{3})@',$http_response_line, $matches)) { $response_code = $matches[1]; } 785 785 786 786 // put the rest of the headers in an array … … 959 959 $this->depth++; 960 960 961 if (!empty($this->in_content)) {961 if (!empty($this->in_content)) { 962 962 $attrs_prefix = array(); 963 963 … … 967 967 } 968 968 $attrs_str = join(' ', array_map( array( &$this, '_map_attrs_func' ), array_keys($attrs_prefix), array_values($attrs_prefix))); 969 if (strlen($attrs_str) > 0) {969 if (strlen($attrs_str) > 0) { 970 970 $attrs_str = " " . $attrs_str; 971 971 } 972 972 973 973 $xmlns_str = join(' ', array_map( array( &$this, '_map_xmlns_func' ), array_keys($this->ns_contexts[0]), array_values($this->ns_contexts[0]))); 974 if (strlen($xmlns_str) > 0) {974 if (strlen($xmlns_str) > 0) { 975 975 $xmlns_str = " " . $xmlns_str; 976 976 } 977 977 978 978 // handle self-closing tags (case: a new child found right-away, no text node) 979 if (count($this->in_content) == 2) {979 if (count($this->in_content) == 2) { 980 980 array_push($this->in_content, ">"); 981 981 } 982 982 983 983 array_push($this->in_content, "<". $this->ns_to_prefix($name) ."{$xmlns_str}{$attrs_str}"); 984 } else if (in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) {984 } else if (in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) { 985 985 $this->in_content = array(); 986 986 $this->is_xhtml = $attrs['type'] == 'xhtml'; 987 987 array_push($this->in_content, array($tag,$this->depth)); 988 } else if ($tag == 'link') {988 } else if ($tag == 'link') { 989 989 array_push($this->entry->links, $attrs); 990 } else if ($tag == 'category') {990 } else if ($tag == 'category') { 991 991 array_push($this->entry->categories, $attrs['term']); 992 992 } … … 999 999 $tag = array_pop(split(":", $name)); 1000 1000 1001 if (!empty($this->in_content)) {1002 if ($this->in_content[0][0] == $tag &&1001 if (!empty($this->in_content)) { 1002 if ($this->in_content[0][0] == $tag && 1003 1003 $this->in_content[0][1] == $this->depth) { 1004 1004 array_shift($this->in_content); 1005 if ($this->is_xhtml) {1005 if ($this->is_xhtml) { 1006 1006 $this->in_content = array_slice($this->in_content, 2, count($this->in_content)-3); 1007 1007 } … … 1036 1036 function cdata($parser, $data) { 1037 1037 #print str_repeat(" ", $this->depth * $this->indent) . "data: #" . $data . "#\n"; 1038 if (!empty($this->in_content)) {1038 if (!empty($this->in_content)) { 1039 1039 // handle self-closing tags (case: text node found, need to close element started) 1040 1040 if (strpos($this->in_content[count($this->in_content)-1], '<') !== false) { … … 1054 1054 $name = array_pop($components); 1055 1055 1056 if (!empty($components)) {1056 if (!empty($components)) { 1057 1057 $ns = join(":",$components); 1058 foreach ($this->ns_contexts as $context) {1059 foreach ($context as $mapping) {1060 if ($mapping[1] == $ns && strlen($mapping[0]) > 0) {1058 foreach ($this->ns_contexts as $context) { 1059 foreach ($context as $mapping) { 1060 if ($mapping[1] == $ns && strlen($mapping[0]) > 0) { 1061 1061 return "$mapping[0]:$name"; 1062 1062 }
Note: See TracChangeset
for help on using the changeset viewer.