diff --git wp-includes/atomlib.php wp-includes/atomlib.php
index 368015a..4847a06 100644
|
|
class AtomParser { |
94 | 94 | |
95 | 95 | $this->feed = new AtomFeed(); |
96 | 96 | $this->current = null; |
97 | | $this->map_attrs_func = create_function('$k,$v', 'return "$k=\"$v\"";'); |
98 | | $this->map_xmlns_func = create_function('$p,$n', '$xd = "xmlns"; if(strlen($n[0])>0) $xd .= ":{$n[0]}"; return "{$xd}=\"{$n[1]}\"";'); |
| 97 | $this->map_attrs_func = array( __CLASS__, 'defaultMapAttrsFunc' ); |
| 98 | $this->map_xmlns_func = array( __CLASS__, 'defaultMapXmlnsFunc' ); |
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
… |
… |
class AtomParser { |
105 | 105 | self::__construct(); |
106 | 106 | } |
107 | 107 | |
| 108 | /** |
| 109 | * Default map_attrs_func implementation |
| 110 | * Produces '{key}="{$val}" with no escaping |
| 111 | * |
| 112 | * @param string $k - Key |
| 113 | * @param string $v - Val |
| 114 | */ |
| 115 | public static function defaultMapAttrsFunc($k, $v) { |
| 116 | return "$k=\"$v\""; |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * Default map_xmlns_func implementation |
| 121 | * Produces 'xmlns="{url}"' or 'xmlns:{namespace}="{url}"' |
| 122 | * |
| 123 | * @param indexish $p - XML Namespace element index |
| 124 | * @param array $n - Two-element array pair. [ 0 => {namespace}, 1 => {url} ] |
| 125 | * @return string |
| 126 | */ |
| 127 | public static function defaultMapXmlnsFunc($p, $n) { |
| 128 | $xd = "xmlns"; |
| 129 | if( 0 < strlen($n[0]) ) { |
| 130 | $xd .= ":{$n[0]}"; |
| 131 | } |
| 132 | return "{$xd}=\"{$n[1]}\""; |
| 133 | } |
| 134 | |
108 | 135 | function _p($msg) { |
109 | 136 | if($this->debug) { |
110 | 137 | print str_repeat(" ", $this->depth * $this->indent) . $msg ."\n"; |