completo_wp - [pdf document] documents. completo_wp. view more

Download Completo_WP - [PDF Document] documents. Completo_WP. View more

If you can't read please download the document

Upload: lamhanh

Post on 25-Feb-2018

306 views

Category:

Documents


45 download

TRANSCRIPT

Completo_WP - [PDF Document]

Sign in Register

Hide

Completo_WP

Category: Documents

DownloadReport copyright

Share:

Copy

Description

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60

Related documentsView more

Transcripts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65

F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-admin\network\admin.php: 1/1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

28

F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-admin\user\admin.php: 1/1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

0) $xd .= ":{$n[0]}"; return "{$xd}=\"{$n[1]}\"";' 96 } 97 98 function _p($msg ) { 99 if ($this ->debug ) { 100 print str_repeat (" " , $this ->depth * $this ->indent ) . $msg ."\n" ; 101 } 102 } 103 104 function error_handler ($log_level , $log_text , $error_file , $error_line ) { 105 $this ->error = $log_text ; 106 } 107 108 function parse () { 109 110 set_error_handler (array (&$this , 'error_handler' )); 111 112 array_unshift ($this ->ns_contexts, array ()); 113 114 $parser = xml_parser_create_ns (); 115 xml_set_object ($parser , $this ); 116 xml_set_element_handler ($parser , "start_element" , "end_element" ); 117 xml_parser_set_option ($parser ,XML_OPTION_CASE_FOLDING ,0); 118 xml_parser_set_option ($parser ,XML_OPTION_SKIP_WHITE ,0); 119 xml_set_character_data_handler ($parser , "cdata" ); 120 xml_set_default_handler ($parser , "_default" ); 121 xml_set_start_namespace_decl_handler ($parser , "start_ns" ); 122 xml_set_end_namespace_decl_handler ($parser , "end_ns" ); 123 124 $this ->content = ''; 125 126 $ret = true ; 127 128 $fp = fopen ($this ->FILE, "r" ); 129 while ($data = fread ($fp , 4096)) { 130 if ($this ->debug ) $this ->content .= $data ; 131 132 if (!xml_parse ($parser , $data , feof ($fp ))) { 133 trigger_error (sprintf (__('XML error: %s at line %d' )."\n" , 134 xml_error_string (xml_get_error_code ($xml_parser )), 135 xml_get_current_line_number ($xml_parser ))); 136 $ret = false ; 137 break ; 138 } 139 } 140 fclose ($fp ); 141 142 xml_parser_free ($parser ); 143 144 restore_error_handler (); 145 146 return $ret ; 147 } 148 149 function start_element ($parser , $name , $attrs ) { 150 151 $tag = array_pop (split (":" , $name )); 152 153 switch ($name ) { 154 case $this ->NS . ':feed' : 155 $this ->current = $this ->feed; 156 break ; 157 case $this ->NS . ':entry' : 158 $this ->current = new AtomEntry (); 159 break ; 160 }; F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\atomlib.php: 2/5

);

161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199

$this ->_p("start_element('$name')" ); #$this->_p(print_r($this->ns_contexts,true)); #$this->_p('current(' . $this->current . ')'); array_unshift ($this ->ns_contexts, $this ->ns_decls ); $this ->depth ++; if (!empty ($this ->in_content )) { $this ->content_ns_decls = array (); if ($this ->is_html || $this ->is_text ) trigger_error ("Invalid content in element found. Content must not be of type text or html if it contains markup." $attrs_prefix = array (); // resolve prefixes for attributes foreach ($attrs as $key => $value ) { $with_prefix = $this ->ns_to_prefix ($key, true ); $attrs_prefix [$with_prefix [1]] = $this ->xml_escape ($value ); } $attrs_str = join (' ' , array_map ($this ->map_attrs_func, array_keys ($attrs_prefix ), array_values ($attrs_prefix ))); if (strlen ($attrs_str ) > 0) { $attrs_str = " " . $attrs_str ; } $with_prefix = $this ->ns_to_prefix ($name ); if (!$this ->is_declared_content_ns ($with_prefix [0])) { array_push ($this ->content_ns_decls, $with_prefix [0]); } $xmlns_str = ''; if (count ($this ->content_ns_decls ) > 0) { array_unshift ($this ->content_ns_contexts, $this ->content_ns_decls ); $xmlns_str .= join (' ' , array_map ($this ->map_xmlns_func, array_keys ($this ->content_ns_contexts [0]), array_values ($this ->co ntent_ns_contexts [0]))); if (strlen ($xmlns_str ) > 0) { $xmlns_str = " " . $xmlns_str ; } }

);

200 201 202 203 204 205 array_push ($this ->in_content, array ($tag , $this ->depth, "" )); 206 207 } else if (in_array ($tag , $this ->ATOM_CONTENT_ELEMENTS) || in_array ($tag , $this ->ATOM_SIMPLE_ELEMENTS )) { 208 $this ->in_content = array (); 209 $this ->is_xhtml = $attrs ['type' ] == 'xhtml' ; 210 $this ->is_html = $attrs ['type' ] == 'html' || $attrs ['type' ] == 'text/html' ; 211 $this ->is_text = !in_array ('type' ,array_keys ($attrs )) || $attrs ['type' ] == 'text' ; 212 $type = $this ->is_xhtml ? 'XHTML' : ($this ->is_html ? 'HTML' : ($this ->is_text ? 'TEXT' : $attrs ['type' ])); 213 214 if (in_array ('src' ,array_keys ($attrs ))) { 215 $this ->current-> $tag = $attrs ; 216 } else { 217 array_push ($this ->in_content, array ($tag ,$this ->depth, $type )); 218 } 219 } else if ($tag == 'link' ) { 220 array_push ($this ->current-> links, $attrs ); 221 } else if ($tag == 'category' ) { 222 array_push ($this ->current-> categories, $attrs ); 223 } 224 225 $this ->ns_decls = array (); 226 } 227 228 function end_element ($parser , $name ) { 229 230 $tag = array_pop (split (":" , $name )); 231 232 $ccount = count ($this ->in_content ); 233 234 # if we are *in* content, then let's proceed to serialize it 235 if (!empty ($this ->in_content )) { 236 # if we are ending the original content element 237 # then let's finalize the content 238 if ($this ->in_content [0][ 0] == $tag && 239 $this ->in_content [0][ 1] == $this ->depth ) { F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\atomlib.php: 3/5

240 $origtype = $this ->in_content [0][ 2]; 241 array_shift ($this ->in_content ); 242 $newcontent = array (); 243 foreach ($this ->in_content as $c) { 244 if (count ($c) == 3) { 245 array_push ($newcontent , $c[2]); 246 } else { 247 if ($this ->is_xhtml || $this ->is_text ) { 248 array_push ($newcontent , $this ->xml_escape ($c)); 249 } else { 250 array_push ($newcontent , $c); 251 } 252 } 253 } 254 if (in_array ($tag , $this ->ATOM_CONTENT_ELEMENTS)) { 255 $this ->current-> $tag = array ($origtype , join ('',$newcontent )); 256 } else { 257 $this ->current-> $tag = join ('',$newcontent ); 258 } 259 $this ->in_content = array (); 260 } else if ($this ->in_content [$ccount -1][ 0] == $tag && 261 $this ->in_content [$ccount -1][ 1] == $this ->depth ) { 262 $this ->in_content [$ccount -1][ 2] = substr ($this ->in_content [$ccount -1][ 2],0,-1) . "/>" ; 263 } else { 264 # else, just finalize the current element's content 265 $endtag = $this ->ns_to_prefix ($name ); 266 array_push ($this ->in_content, array ($tag , $this ->depth, "" )); 267 } 268 } 269 270 array_shift ($this ->ns_contexts ); 271 272 $this ->depth --; 273 274 if ($name == ($this ->NS . ':entry' )) { 275 array_push ($this ->feed ->entries, $this ->current ); 276 $this ->current = null; 277 } 278 279 $this ->_p("end_element('$name')" ); 280 } 281 282 function start_ns ($parser , $prefix , $uri ) { 283 $this ->_p("starting: " . $prefix . ":" . $uri ); 284 array_push ($this ->ns_decls, array ($prefix ,$uri )); 285 } 286 287 function end_ns ($parser , $prefix ) { 288 $this ->_p("ending: #" . $prefix . "#" ); 289 } 290 291 function cdata ($parser , $data ) { 292 $this ->_p("data: #" . str_replace (array ("\n" ), array ("\\n" ), trim ($data )) . "#" ); 293 if (!empty ($this ->in_content )) { 294 array_push ($this ->in_content, $data ); 295 } 296 } 297 298 function _default ($parser , $data ) { 299 # when does this gets called? 300 } 301 302 303 function ns_to_prefix ($qname , $attr =false ) { 304 # split 'http://www.w3.org/1999/xhtml:div' into ('http','//www.w3.org/1999/xhtml','div') 305 $components = split (":" , $qname ); 306 307 # grab the last one (e.g 'div') 308 $name = array_pop ($components ); 309 310 if (!empty ($components )) { 311 # re-join back the namespace component 312 $ns = join (":" ,$components ); 313 foreach ($this ->ns_contexts as $context ) { 314 foreach ($context as $mapping ) { 315 if ($mapping [1] == $ns && strlen ($mapping [0]) > 0) { 316 return array ($mapping , "$mapping[0]:$name" ); 317 } 318 } 319 } F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\atomlib.php: 4/5

320 } 321 322 if ($attr ) { 323 return array (null, $name ); 324 } else { 325 foreach ($this ->ns_contexts as $context ) { 326 foreach ($context as $mapping ) { 327 if (strlen ($mapping [0]) == 0) { 328 return array ($mapping , $name ); 329 } 330 } 331 } 332 } 333 } 334 335 function is_declared_content_ns ($new_mapping ) { 336 foreach ($this ->content_ns_contexts as $context ) { 337 foreach ($context as $mapping ) { 338 if ($new_mapping == $mapping ) { 339 return true ; 340 } 341 } 342 } 343 return false ; 344 } 345 346 function xml_escape ($string ) 347 { 348 return str_replace (array ('&' ,'"' ,"'" ,'' ), 349 array ('&' ,'"' ,''' ,'' ), 350 $string ); 351 } 352 } 353 354 ?> 355

F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\atomlib.php: 5/5

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55

data = $data; 55 if (!$type) { 56 $type = $this->calculateType(); 57 } 58 $this->type = $type; 59 if ($type == 'struct') { 60 // Turn all the values in the array in to new IXR_Value objects 61 foreach ($this->data as $key => $value) { 62 $this->data[$key] = new IXR_Value($value); 63 } 64 } 65 if ($type == 'array') { 66 for ($i = 0, $j = count($this->data); $i < $j; $i++) { 67 $this->data[$i] = new IXR_Value($this->data[$i]); 68 } 69 } 70 } 71 72 function calculateType() 73 { 74 if ($this->data === true || $this->data === false) { 75 return 'boolean'; 76 } 77 if (is_integer($this->data)) { 78 return 'int'; 79 } 80 if (is_double($this->data)) { F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-IXR.php: 1/14

81 return 'double'; 82 } 83 84 // Deal with IXR object types base64 and date 85 if (is_object($this->data) && is_a($this->data, 'IXR_Date')) { 86 return 'date'; 87 } 88 if (is_object($this->data) && is_a($this->data, 'IXR_Base64')) { 89 return 'base64'; 90 } 91 92 // If it is a normal PHP object convert it in to a struct 93 if (is_object($this->data)) { 94 $this->data = get_object_vars($this->data); 95 return 'struct'; 96 } 97 if (!is_array($this->data)) { 98 return 'string'; 99 } 100 101 // We have an array - is it an array or a struct? 102 if ($this->isStruct($this->data)) { 103 return 'struct'; 104 } else { 105 return 'array'; 106 } 107 } 108 109 function getXml() 110 { 111 // Return XML for this value 112 switch ($this->type) { 113 case 'boolean': 114 return ''.(($this->data) ? '1' : '0').''; 115 break; 116 case 'int': 117 return ''.$this->data.''; 118 break; 119 case 'double': 120 return ''.$this->data.''; 121 break; 122 case 'string': 123 return ''.htmlspecialchars($this->data).''; 124 break; 125 case 'array': 126 $return = ''."\n"; 127 foreach ($this->data as $item) { 128 $return .= ' '.$item->getXml()."\n"; 129 } 130 $return .= ''; 131 return $return; 132 break; 133 case 'struct': 134 $return = ''."\n"; 135 foreach ($this->data as $name => $value) { 136 $name = htmlspecialchars($name); 137 $return .= " $name"; 138 $return .= $value->getXml()."\n"; 139 } 140 $return .= ''; 141 return $return; 142 break; 143 case 'date': 144 case 'base64': 145 return $this->data->getXml(); 146 break; 147 } 148 return false; 149 } 150 151 /** 152 * Checks whether or not the supplied array is a struct or not 153 * 154 * @param unknown_type $array 155 * @return boolean 156 */ 157 function isStruct($array) 158 { 159 $expected = 0; 160 foreach ($array as $key => $value) { F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-IXR.php: 2/14

161 if ((string)$key != (string)$expected) { 162 return true; 163 } 164 $expected++; 165 } 166 return false; 167 } 168 } 169 170 /** 171 * IXR_MESSAGE 172 * 173 * @package IXR 174 * @since 1.5 175 * 176 */ 177 class IXR_Message 178 { 179 var $message; 180 var $messageType; // methodCall / methodResponse / fault 181 var $faultCode; 182 var $faultString; 183 var $methodName; 184 var $params; 185 186 // Current variable stacks 187 var $_arraystructs = array(); // The stack used to keep track of the current array/struct 188 var $_arraystructstypes = array(); // Stack keeping track of if things are structs or array 189 var $_currentStructName = array(); // A stack as well 190 var $_param; 191 var $_value; 192 var $_currentTag; 193 var $_currentTagContents; 194 // The XML parser 195 var $_parser; 196 197 function IXR_Message($message) 198 { 199 $this->message =& $message; 200 } 201 202 function parse() 203 { 204 // first remove the XML declaration 205 // merged from WP #10698 - this method avoids the RAM usage of preg_replace on very large messages 206 $header = preg_replace( '//', '', substr($this->message, 0, 100), 1); 207 $this->message = substr_replace($this->message, $header, 0, 100); 208 if (trim($this->message) == '') { 209 return false; 210 } 211 $this->_parser = xml_parser_create(); 212 // Set XML parser to take the case of tags in to account 213 xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false); 214 // Set XML parser callback functions 215 xml_set_object($this->_parser, $this); 216 xml_set_element_handler($this->_parser, 'tag_open', 'tag_close'); 217 xml_set_character_data_handler($this->_parser, 'cdata'); 218 $chunk_size = 262144; // 256Kb, parse in chunks to avoid the RAM usage on very large messages 219 $final = false; 220 do { 221 if (strlen($this->message) message, 0, $chunk_size); 225 $this->message = substr($this->message, $chunk_size); 226 if (!xml_parse($this->_parser, $part, $final)) { 227 return false; 228 } 229 if ($final) { 230 break; 231 } 232 } while (true); 233 xml_parser_free($this->_parser); 234 235 // Grab the error messages, if any 236 if ($this->messageType == 'fault') { 237 $this->faultCode = $this->params[0]['faultCode']; 238 $this->faultString = $this->params[0]['faultString']; 239 } 240 return true; F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-IXR.php: 3/14

241 } 242 243 function tag_open($parser, $tag, $attr) 244 { 245 $this->_currentTagContents = ''; 246 $this->currentTag = $tag; 247 switch($tag) { 248 case 'methodCall': 249 case 'methodResponse': 250 case 'fault': 251 $this->messageType = $tag; 252 break; 253 /* Deal with stacks of arrays and structs */ 254 case 'data': // data is to all intents and puposes more interesting than array 255 $this->_arraystructstypes[] = 'array'; 256 $this->_arraystructs[] = array(); 257 break; 258 case 'struct': 259 $this->_arraystructstypes[] = 'struct'; 260 $this->_arraystructs[] = array(); 261 break; 262 } 263 } 264 265 function cdata($parser, $cdata) 266 { 267 $this->_currentTagContents .= $cdata; 268 } 269 270 function tag_close($parser, $tag) 271 { 272 $valueFlag = false; 273 switch($tag) { 274 case 'int': 275 case 'i4': 276 $value = (int)trim($this->_currentTagContents); 277 $valueFlag = true; 278 break; 279 case 'double': 280 $value = (double)trim($this->_currentTagContents); 281 $valueFlag = true; 282 break; 283 case 'string': 284 $value = (string)trim($this->_currentTagContents); 285 $valueFlag = true; 286 break; 287 case 'dateTime.iso8601': 288 $value = new IXR_Date(trim($this->_currentTagContents)); 289 $valueFlag = true; 290 break; 291 case 'value': 292 // "If no type is indicated, the type is string." 293 if (trim($this->_currentTagContents) != '') { 294 $value = (string)$this->_currentTagContents; 295 $valueFlag = true; 296 } 297 break; 298 case 'boolean': 299 $value = (boolean)trim($this->_currentTagContents); 300 $valueFlag = true; 301 break; 302 case 'base64': 303 $value = base64_decode($this->_currentTagContents); 304 $valueFlag = true; 305 break; 306 /* Deal with stacks of arrays and structs */ 307 case 'data': 308 case 'struct': 309 $value = array_pop($this->_arraystructs); 310 array_pop($this->_arraystructstypes); 311 $valueFlag = true; 312 break; 313 case 'member': 314 array_pop($this->_currentStructName); 315 break; 316 case 'name': 317 $this->_currentStructName[] = trim($this->_currentTagContents); 318 break; 319 case 'methodName': 320 $this->methodName = trim($this->_currentTagContents); F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-IXR.php: 4/14

321 break; 322 } 323 324 if ($valueFlag) { 325 if (count($this->_arraystructs) > 0) { 326 // Add value to struct or array 327 if ($this->_arraystructstypes[count($this->_arraystructstypes)-1] == 'struct') { 328 // Add to struct 329 $this->_arraystructs[count($this->_arraystructs)-1][$this->_currentStructName[count($this->_currentStructName)-1]] = $value; 330 } else { 331 // Add to array 332 $this->_arraystructs[count($this->_arraystructs)-1][] = $value; 333 } 334 } else { 335 // Just add as a paramater 336 $this->params[] = $value; 337 } 338 } 339 $this->_currentTagContents = ''; 340 } 341 } 342 343 /** 344 * IXR_Server 345 * 346 * @package IXR 347 * @since 1.5 348 */ 349 class IXR_Server 350 { 351 var $data; 352 var $callbacks = array(); 353 var $message; 354 var $capabilities; 355 356 function IXR_Server($callbacks = false, $data = false, $wait = false) 357 { 358 $this->setCapabilities(); 359 if ($callbacks) { 360 $this->callbacks = $callbacks; 361 } 362 $this->setCallbacks(); 363 if (!$wait) { 364 $this->serve($data); 365 } 366 } 367 368 function serve($data = false) 369 { 370 if (!$data) { 371 if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] !== 'POST') { 372 header('Content-Type: text/plain'); // merged from WP #9093 373 die('XML-RPC server accepts POST requests only.'); 374 } 375 376 global $HTTP_RAW_POST_DATA; 377 if (empty($HTTP_RAW_POST_DATA)) { 378 // workaround for a bug in PHP 5.2.2 - http://bugs.php.net/bug.php?id=41293 379 $data = file_get_contents('php://input'); 380 } else { 381 $data =& $HTTP_RAW_POST_DATA; 382 } 383 } 384 $this->message = new IXR_Message($data); 385 if (!$this->message->parse()) { 386 $this->error(-32700, 'parse error. not well formed'); 387 } 388 if ($this->message->messageType != 'methodCall') { 389 $this->error(-32600, 'server error. invalid xml-rpc. not conforming to spec. Request must be a methodCall'); 390 } 391 $result = $this->call($this->message->methodName, $this->message->params); 392 393 // Is the result an error? 394 if (is_a($result, 'IXR_Error')) { 395 $this->error($result); 396 } 397 398 // Encode the result 399 $r = new IXR_Value($result); 400 $resultxml = $r->getXml(); F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-IXR.php: 5/14

401 402 // Create the XML 403 $xml = callbacks[$methodname]; 425 426 // Perform the callback and send the response 427 if (count($args) == 1) { 428 // If only one paramater just send that instead of the whole array 429 $args = $args[0]; 430 } 431 432 // Are we dealing with a function or a method? 433 if (is_string($method) && substr($method, 0, 5) == 'this:') { 434 // It's a class method - check it exists 435 $method = substr($method, 5); 436 if (!method_exists($this, $method)) { 437 return new IXR_Error(-32601, 'server error. requested class method "'.$method.'" does not exist.'); 438 } 439 440 //Call the method 441 $result = $this->$method($args); 442 } else { 443 // It's a function - does it exist? 444 if (is_array($method)) { 445 if (!is_callable(array($method[0], $method[1]))) { 446 return new IXR_Error(-32601, 'server error. requested object method "'.$method[1].'" does not exist.'); 447 } 448 } else if (!function_exists($method)) { 449 return new IXR_Error(-32601, 'server error. requested function "'.$method.'" does not exist.'); 450 } 451 452 // Call the function 453 $result = call_user_func($method, $args); 454 } 455 return $result; 456 } 457 458 function error($error, $message = false) 459 { 460 // Accepts either an error object or an error code and message 461 if ($message && !is_object($error)) { 462 $error = new IXR_Error($error, $message); 463 } 464 $this->output($error->getXml()); 465 } 466 467 function output($xml) 468 { 469 $xml = ''."\n".$xml; 470 $length = strlen($xml); 471 header('Connection: close'); 472 header('Content-Length: '.$length); 473 header('Content-Type: text/xml'); 474 header('Date: '.date('r')); 475 echo $xml; 476 exit; 477 } 478 479 function hasMethod($method) 480 { F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-IXR.php: 6/14

481 return in_array($method, array_keys($this->callbacks)); 482 } 483 484 function setCapabilities() 485 { 486 // Initialises capabilities array 487 $this->capabilities = array( 488 'xmlrpc' => array( 489 'specUrl' => 'http://www.xmlrpc.com/spec', 490 'specVersion' => 1 491 ), 492 'faults_interop' => array( 493 'specUrl' => 'http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php', 494 'specVersion' => 20010516 495 ), 496 'system.multicall' => array( 497 'specUrl' => 'http://www.xmlrpc.com/discuss/msgReader$1208', 498 'specVersion' => 1 499 ), 500 ); 501 } 502 503 function getCapabilities($args) 504 { 505 return $this->capabilities; 506 } 507 508 function setCallbacks() 509 { 510 $this->callbacks['system.getCapabilities'] = 'this:getCapabilities'; 511 $this->callbacks['system.listMethods'] = 'this:listMethods'; 512 $this->callbacks['system.multicall'] = 'this:multiCall'; 513 } 514 515 function listMethods($args) 516 { 517 // Returns a list of methods - uses array_reverse to ensure user defined 518 // methods are listed before server defined methods 519 return array_reverse(array_keys($this->callbacks)); 520 } 521 522 function multiCall($methodcalls) 523 { 524 // See http://www.xmlrpc.com/discuss/msgReader$1208 525 $return = array(); 526 foreach ($methodcalls as $call) { 527 $method = $call['methodName']; 528 $params = $call['params']; 529 if ($method == 'system.multicall') { 530 $result = new IXR_Error(-32600, 'Recursive calls to system.multicall are forbidden'); 531 } else { 532 $result = $this->call($method, $params); 533 } 534 if (is_a($result, 'IXR_Error')) { 535 $return[] = array( 536 'faultCode' => $result->code, 537 'faultString' => $result->message 538 ); 539 } else { 540 $return[] = array($result); 541 } 542 } 543 return $return; 544 } 545 } 546 547 /** 548 * IXR_Request 549 * 550 * @package IXR 551 * @since 1.5 552 */ 553 class IXR_Request 554 { 555 var $method; 556 var $args; 557 var $xml; 558 559 function IXR_Request($method, $args) 560 { F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-IXR.php: 7/14

561 $this->method = $method; 562 $this->args = $args; 563 $this->xml = xml .= ' '; 572 $v = new IXR_Value($arg); 573 $this->xml .= $v->getXml(); 574 $this->xml .= " \n"; 575 } 576 $this->xml .= ' '; 577 } 578 579 function getLength() 580 { 581 return strlen($this->xml); 582 } 583 584 function getXml() 585 { 586 return $this->xml; 587 } 588 } 589 590 /** 591 * IXR_Client 592 * 593 * @package IXR 594 * @since 1.5 595 * 596 */ 597 class IXR_Client 598 { 599 var $server; 600 var $port; 601 var $path; 602 var $useragent; 603 var $response; 604 var $message = false; 605 var $debug = false; 606 var $timeout; 607 var $headers = array(); 608 609 // Storage place for an error message 610 var $error = false; 611 612 function IXR_Client($server, $path = false, $port = 80, $timeout = 15) 613 { 614 if (!$path) { 615 // Assume we have been given a URL instead 616 $bits = parse_url($server); 617 $this->server = $bits['host']; 618 $this->port = isset($bits['port']) ? $bits['port'] : 80; 619 $this->path = isset($bits['path']) ? $bits['path'] : '/'; 620 621 // Make absolutely sure we have a path 622 if (!$this->path) { 623 $this->path = '/'; 624 } 625 } else { 626 $this->server = $server; 627 $this->path = $path; 628 $this->port = $port; 629 } 630 $this->useragent = 'The Incutio XML-RPC PHP Library'; 631 $this->timeout = $timeout; 632 } 633 634 function query() 635 { 636 $args = func_get_args(); 637 $method = array_shift($args); 638 $request = new IXR_Request($method, $args); 639 $length = $request->getLength(); 640 $xml = $request->getXml(); F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-IXR.php: 8/14

641 $r = "\r\n"; 642 $request = "POST {$this->path} HTTP/1.0$r"; 643 644 // Merged from WP #8145 - allow custom headers 645 $this->headers['Host'] = $this->server; 646 $this->headers['Content-Type'] = 'text/xml'; 647 $this->headers['User-Agent'] = $this->useragent; 648 $this->headers['Content-Length']= $length; 649 650 foreach( $this->headers as $header => $value ) { 651 $request .= "{$header}: {$value}{$r}"; 652 } 653 $request .= $r; 654 655 $request .= $xml; 656 657 // Now send the request 658 if ($this->debug) { 659 echo ' '.htmlspecialchars($request)."\n \n\n"; 660 } 661 662 if ($this->timeout) { 663 $fp = @fsockopen($this->server, $this->port, $errno, $errstr, $this->timeout); 664 } else { 665 $fp = @fsockopen($this->server, $this->port, $errno, $errstr); 666 } 667 if (!$fp) { 668 $this->error = new IXR_Error(-32300, 'transport error - could not open socket'); 669 return false; 670 } 671 fputs($fp, $request); 672 $contents = ''; 673 $debugContents = ''; 674 $gotFirstLine = false; 675 $gettingHeaders = true; 676 while (!feof($fp)) { 677 $line = fgets($fp, 4096); 678 if (!$gotFirstLine) { 679 // Check line for '200' 680 if (strstr($line, '200') === false) { 681 $this->error = new IXR_Error(-32300, 'transport error - HTTP status code was not 200'); 682 return false; 683 } 684 $gotFirstLine = true; 685 } 686 if (trim($line) == '') { 687 $gettingHeaders = false; 688 } 689 if (!$gettingHeaders) { 690 // merged from WP #12559 - remove trim 691 $contents .= $line; 692 } 693 if ($this->debug) { 694 $debugContents .= $line; 695 } 696 } 697 if ($this->debug) { 698 echo ' '.htmlspecialchars($debugContents)."\n \n\n"; 699 } 700 701 // Now parse what we've got back 702 $this->message = new IXR_Message($contents); 703 if (!$this->message->parse()) { 704 // XML error 705 $this->error = new IXR_Error(-32700, 'parse error. not well formed'); 706 return false; 707 } 708 709 // Is the message a fault? 710 if ($this->message->messageType == 'fault') { 711 $this->error = new IXR_Error($this->message->faultCode, $this->message->faultString); 712 return false; 713 } 714 715 // Message must be OK 716 return true; 717 } 718 719 function getResponse() 720 { F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-IXR.php: 9/14

721 // methodResponses can only have one param - return that 722 return $this->message->params[0]; 723 } 724 725 function isError() 726 { 727 return (is_object($this->error)); 728 } 729 730 function getErrorCode() 731 { 732 return $this->error->code; 733 } 734 735 function getErrorMessage() 736 { 737 return $this->error->message; 738 } 739 } 740 741 742 /** 743 * IXR_Error 744 * 745 * @package IXR 746 * @since 1.5 747 */ 748 class IXR_Error 749 { 750 var $code; 751 var $message; 752 753 function IXR_Error($code, $message) 754 { 755 $this->code = $code; 756 $this->message = htmlspecialchars($message); 757 } 758 759 function getXml() 760 { 761 $xml = parseTimestamp($time); 804 } else { 805 $this->parseIso($time); 806 } 807 } 808 809 function parseTimestamp($timestamp) 810 { 811 $this->year = date('Y', $timestamp); 812 $this->month = date('m', $timestamp); 813 $this->day = date('d', $timestamp); 814 $this->hour = date('H', $timestamp); 815 $this->minute = date('i', $timestamp); 816 $this->second = date('s', $timestamp); 817 $this->timezone = ''; 818 } 819 820 function parseIso($iso) 821 { 822 $this->year = substr($iso, 0, 4); 823 $this->month = substr($iso, 4, 2); 824 $this->day = substr($iso, 6, 2); 825 $this->hour = substr($iso, 9, 2); 826 $this->minute = substr($iso, 12, 2); 827 $this->second = substr($iso, 15, 2); 828 $this->timezone = substr($iso, 17); 829 } 830 831 function getIso() 832 { 833 return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second.$this->timezone; 834 } 835 836 function getXml() 837 { 838 return ' '.$this->getIso().' '; 839 } 840 841 function getTimestamp() 842 { 843 return mktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year); 844 } 845 } 846 847 /** 848 * IXR_Base64 849 * 850 * @package IXR 851 * @since 1.5 852 */ 853 class IXR_Base64 854 { 855 var $data; 856 857 function IXR_Base64($data) 858 { 859 $this->data = $data; 860 } 861 862 function getXml() 863 { 864 return ' '.base64_encode($this->data).' '; 865 } 866 } 867 868 /** 869 * IXR_IntrospectionServer 870 * 871 * @package IXR 872 * @since 1.5 873 */ 874 class IXR_IntrospectionServer extends IXR_Server 875 { 876 var $signatures; 877 var $help; 878 879 function IXR_IntrospectionServer() 880 { F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-IXR.php: 11/14

881 $this->setCallbacks(); 882 $this->setCapabilities(); 883 $this->capabilities['introspection'] = array( 884 'specUrl' => 'http://xmlrpc.usefulinc.com/doc/reserved.html', 885 'specVersion' => 1 886 ); 887 $this->addCallback( 888 'system.methodSignature', 889 'this:methodSignature', 890 array('array', 'string'), 891 'Returns an array describing the return type and required parameters of a method' 892 ); 893 $this->addCallback( 894 'system.getCapabilities', 895 'this:getCapabilities', 896 array('struct'), 897 'Returns a struct describing the XML-RPC specifications supported by this server' 898 ); 899 $this->addCallback( 900 'system.listMethods', 901 'this:listMethods', 902 array('array'), 903 'Returns an array of available methods on this server' 904 ); 905 $this->addCallback( 906 'system.methodHelp', 907 'this:methodHelp', 908 array('string', 'string'), 909 'Returns a documentation string for the specified method' 910 ); 911 } 912 913 function addCallback($method, $callback, $args, $help) 914 { 915 $this->callbacks[$method] = $callback; 916 $this->signatures[$method] = $args; 917 $this->help[$method] = $help; 918 } 919 920 function call($methodname, $args) 921 { 922 // Make sure it's in an array 923 if ($args && !is_array($args)) { 924 $args = array($args); 925 } 926 927 // Over-rides default call method, adds signature check 928 if (!$this->hasMethod($methodname)) { 929 return new IXR_Error(-32601, 'server error. requested method "'.$this->message->methodName.'" not specified.'); 930 } 931 $method = $this->callbacks[$methodname]; 932 $signature = $this->signatures[$methodname]; 933 $returnType = array_shift($signature); 934 935 // Check the number of arguments 936 if (count($args) != count($signature)) { 937 return new IXR_Error(-32602, 'server error. wrong number of method parameters'); 938 } 939 940 // Check the argument types 941 $ok = true; 942 $argsbackup = $args; 943 for ($i = 0, $j = count($args); $i < $j; $i++) { 944 $arg = array_shift($args); 945 $type = array_shift($signature); 946 switch ($type) { 947 case 'int': 948 case 'i4': 949 if (is_array($arg) || !is_int($arg)) { 950 $ok = false; 951 } 952 break; 953 case 'base64': 954 case 'string': 955 if (!is_string($arg)) { 956 $ok = false; 957 } 958 break; 959 case 'boolean': 960 if ($arg !== false && $arg !== true) { F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-IXR.php: 12/14

961 $ok = false; 962 } 963 break; 964 case 'float': 965 case 'double': 966 if (!is_float($arg)) { 967 $ok = false; 968 } 969 break; 970 case 'date': 971 case 'dateTime.iso8601': 972 if (!is_a($arg, 'IXR_Date')) { 973 $ok = false; 974 } 975 break; 976 } 977 if (!$ok) { 978 return new IXR_Error(-32602, 'server error. invalid method parameters'); 979 } 980 } 981 // It passed the test - run the "real" method call 982 return parent::call($methodname, $argsbackup); 983 } 984 985 function methodSignature($method) 986 { 987 if (!$this->hasMethod($method)) { 988 return new IXR_Error(-32601, 'server error. requested method "'.$method.'" not specified.'); 989 } 990 // We should be returning an array of types 991 $types = $this->signatures[$method]; 992 $return = array(); 993 foreach ($types as $type) { 994 switch ($type) { 995 case 'string': 996 $return[] = 'string'; 997 break; 998 case 'int': 999 case 'i4': 1000 $return[] = 42; 1001 break; 1002 case 'double': 1003 $return[] = 3.1415; 1004 break; 1005 case 'dateTime.iso8601': 1006 $return[] = new IXR_Date(time()); 1007 break; 1008 case 'boolean': 1009 $return[] = true; 1010 break; 1011 case 'base64': 1012 $return[] = new IXR_Base64('base64'); 1013 break; 1014 case 'array': 1015 $return[] = array('array'); 1016 break; 1017 case 'struct': 1018 $return[] = array('struct' => 'struct'); 1019 break; 1020 } 1021 } 1022 return $return; 1023 } 1024 1025 function methodHelp($method) 1026 { 1027 return $this->help[$method]; 1028 } 1029 } 1030 1031 /** 1032 * IXR_ClientMulticall 1033 * 1034 * @package IXR 1035 * @since 1.5 1036 */ 1037 class IXR_ClientMulticall extends IXR_Client 1038 { 1039 var $calls = array(); 1040 F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-IXR.php: 13/14

1041 function IXR_ClientMulticall($server, $path = false, $port = 80) 1042 { 1043 parent::IXR_Client($server, $path, $port); 1044 $this->useragent = 'The Incutio XML-RPC PHP Library (multicall client)'; 1045 } 1046 1047 function addCall() 1048 { 1049 $args = func_get_args(); 1050 $methodName = array_shift($args); 1051 $struct = array( 1052 'methodName' => $methodName, 1053 'params' => $args 1054 ); 1055 $this->calls[] = $struct; 1056 } 1057 1058 function query() 1059 { 1060 // Prepare multicall, then call the parent::query() method 1061 return parent::query('system.multicall', $this->calls); 1062 } 1063 } 1064 1065 ?> 1066

F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-IXR.php: 14/14

1 discover ( $url ); 88 89 if ( !$provider || false === $data = $this ->fetch ( $provider , $url , $args ) ) 90 return false ; 91 92 return apply_filters ( 'oembed_result' , $this ->data2html ( $data , $url ), $url , $args ); 93 } 94 95 /** 96 * Attempts to find oEmbed provider discovery tags at the given URL. 97 * 98 * @param string $url The URL that should be inspected for discovery tags. 99 * @return bool|string False on failure, otherwise the oEmbed provider URL. 100 */ 101 function discover ( $url ) { 102 $providers = array (); 103 104 // Fetch URL content 105 if ( $html = wp_remote_retrieve_body ( wp_remote_get ( $url ) ) ) { 106 107 // types that contain oEmbed provider URLs 108 $linktypes = apply_filters ( 'oembed_linktypes' , array ( 109 'application/json+oembed' => 'json' , 110 'text/xml+oembed' => 'xml' , 111 'application/xml+oembed' => 'xml' , // Incorrect, but used by at least Vimeo 112 ) ); 113 114 // Strip 115 $html = substr ( $html , 0, stripos ( $html , '' ) ); 116 117 // Do a quick check 118 $tagfound = false ; 119 foreach ( $linktypes as $linktype => $format ) { 120 if ( stripos ($html , $linktype ) ) { 121 $tagfound = true ; 122 break ; 123 } 124 } 125 126 if ( $tagfound && preg_match_all ( '//i' , $html , $links ) ) { 127 foreach ( $links [1] as $link ) { 128 $atts = shortcode_parse_atts ( $link ); 129 130 if ( !empty ($atts ['type' ]) && !empty ($linktypes [$atts ['type' ]]) && !empty ($atts ['href' ]) ) { 131 $providers [$linktypes [$atts ['type' ]]] = $atts ['href' ]; 132 133 // Stop here if it's JSON (that's all we need) 134 if ( 'json' == $linktypes [$atts ['type' ]] ) 135 break ; 136 } 137 } 138 } 139 } 140 141 // JSON is preferred to XML 142 if ( !empty ($providers ['json' ]) ) 143 return $providers ['json' ]; 144 elseif ( !empty ($providers ['xml' ]) ) 145 return $providers ['xml' ]; 146 else 147 return false ; 148 } 149 150 /** 151 * Connects to a oEmbed provider and returns the result. 152 * 153 * @param string $provider The URL to the oEmbed provider. 154 * @param string $url The URL to the content that is desired to be embedded. 155 * @param array $args Optional arguments. Usually passed from a shortcode. 156 * @return bool|object False on failure, otherwise the result in the form of an object. 157 */ 158 function fetch ( $provider , $url , $args = '' ) { 159 $args = wp_parse_args ( $args , wp_embed_defaults () ); F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-oembed.php: 2/4

160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238

$provider = add_query_arg ( 'maxwidth' , (int ) $args ['width' ], $provider ); $provider = add_query_arg ( 'maxheight' , (int ) $args ['height' ], $provider ); $provider = add_query_arg ( 'url' , urlencode ($url ), $provider ); foreach ( array ( 'json' , 'xml' ) as $format ) { $result = $this ->_fetch_with_format ( $provider , $format ); if ( is_wp_error ( $result ) && 'not-implemented' == $result ->get_error_code () ) continue ; return ( $result && ! is_wp_error ( $result ) ) ? $result : false ; } return false ; } /** * Fetches result from an oEmbed provider for a specific format and complete provider URL * * @since 3.0.0 * @access private * @param string $provider_url_with_args URL to the provider with full arguments list (url, maxheight, etc.) * @param string $format Format to use * @return bool|object False on failure, otherwise the result in the form of an object. */ function _fetch_with_format ( $provider_url_with_args , $format ) { $provider_url_with_args = add_query_arg ( 'format' , $format , $provider_url_with_args ); $response = wp_remote_get ( $provider_url_with_args ); if ( 501 == wp_remote_retrieve_response_code ( $response ) ) return new WP_Error ( 'not-implemented' ); if ( ! $body = wp_remote_retrieve_body ( $response ) ) return false ; $parse_method = "_parse_$format" ; return $this ->$parse_method ( $body ); } /** * Parses a json response body. * * @since 3.0.0 * @access private */ function _parse_json ( $response_body ) { return ( ( $data = json_decode ( trim ( $response_body ) ) ) && is_object ( $data ) ) ? $data : false ; } /** * Parses an XML response body. * * @since 3.0.0 * @access private */ function _parse_xml ( $response_body ) { if ( function_exists ('simplexml_load_string' ) ) { $errors = libxml_use_internal_errors ( 'true' ); $data = simplexml_load_string ( $response_body ); libxml_use_internal_errors ( $errors ); if ( is_object ( $data ) ) return $data ; } return false ; } /** * Converts a data object from {@link WP_oEmbed::fetch()} and returns the HTML. * * @param object $data A data object result from an oEmbed provider. * @param string $url The URL to the content that is desired to be embedded. * @return bool|string False on error, otherwise the HTML needed to embed. */ function data2html ( $data , $url ) { if ( !is_object ($data ) || empty ($data ->type ) ) return false ; switch ( $data ->type ) { case 'photo' : if ( empty ($data ->url ) || empty ($data ->width ) || empty ($data ->height ) ) return false ;

$title = ( !empty ($data ->title ) ) ? $data ->title : ''; $return = '' ; F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-oembed.php: 3/4

239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295

break ; case 'video' : case 'rich' : $return = ( !empty ($data ->html ) ) ? $data ->html : false ; break ; case 'link' : $return = ( !empty ($data ->title ) ) ? '' . esc_html ($data ->title ) . '' : false ; break ; default ; $return = false ; } // You can use this filter to add support for custom data types or to filter the result return apply_filters ( 'oembed_dataparse' , $return , $data , $url ); } /** * Strip any new lines from the HTML. * * @access private * @param string $html Existing HTML. * @param object $data Data object from WP_oEmbed::data2html() * @param string $url The original URL passed to oEmbed. * @return string Possibly modified $html */ function _strip_newlines ( $html , $data , $url ) { if ( false !== strpos ( $html , "\n" ) ) $html = str_replace ( array ( "\r\n" , "\n" ), '', $html ); return $html ; } } /** * Returns the initialized {@link WP_oEmbed} object * * @since 2.9.0 * @access private * * @see WP_oEmbed * @uses WP_oEmbed * * @return WP_oEmbed object. */ function &_wp_oembed_get_object () { static $wp_oembed ; if ( is_null ($wp_oembed ) ) $wp_oembed = new WP_oEmbed (); return $wp_oembed ; } ?>

F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-oembed.php: 4/4

1 'application/vnd.wap.wbxml' , 2067 'wmlc' => 'application/vnd.wap.wmlc' , 2068 'dcr' => 'application/x-director' , 2069 'dir' => 'application/x-director' , 2070 'dxr' => 'application/x-director' , 2071 'dvi' => 'application/x-dvi' , 2072 'gtar' => 'application/x-gtar' , 2073 'php' => 'application/x-httpd-php' , F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-phpmailer.php: 26/30

2074 'php4' => 'application/x-httpd-php' , 2075 'php3' => 'application/x-httpd-php' , 2076 'phtml' => 'application/x-httpd-php' , 2077 'phps' => 'application/x-httpd-php-source' , 2078 'js' => 'application/x-javascript' , 2079 'swf' => 'application/x-shockwave-flash' , 2080 'sit' => 'application/x-stuffit' , 2081 'tar' => 'application/x-tar' , 2082 'tgz' => 'application/x-tar' , 2083 'xhtml' => 'application/xhtml+xml' , 2084 'xht' => 'application/xhtml+xml' , 2085 'zip' => 'application/zip' , 2086 'mid' => 'audio/midi' , 2087 'midi' => 'audio/midi' , 2088 'mpga' => 'audio/mpeg' , 2089 'mp2' => 'audio/mpeg' , 2090 'mp3' => 'audio/mpeg' , 2091 'aif' => 'audio/x-aiff' , 2092 'aiff' => 'audio/x-aiff' , 2093 'aifc' => 'audio/x-aiff' , 2094 'ram' => 'audio/x-pn-realaudio' , 2095 'rm' => 'audio/x-pn-realaudio' , 2096 'rpm' => 'audio/x-pn-realaudio-plugin' , 2097 'ra' => 'audio/x-realaudio' , 2098 'rv' => 'video/vnd.rn-realvideo' , 2099 'wav' => 'audio/x-wav' , 2100 'bmp' => 'image/bmp' , 2101 'gif' => 'image/gif' , 2102 'jpeg' => 'image/jpeg' , 2103 'jpg' => 'image/jpeg' , 2104 'jpe' => 'image/jpeg' , 2105 'png' => 'image/png' , 2106 'tiff' => 'image/tiff' , 2107 'tif' => 'image/tiff' , 2108 'css' => 'text/css' , 2109 'html' => 'text/html' , 2110 'htm' => 'text/html' , 2111 'shtml' => 'text/html' , 2112 'txt' => 'text/plain' , 2113 'text' => 'text/plain' , 2114 'log' => 'text/plain' , 2115 'rtx' => 'text/richtext' , 2116 'rtf' => 'text/rtf' , 2117 'xml' => 'text/xml' , 2118 'xsl' => 'text/xml' , 2119 'mpeg' => 'video/mpeg' , 2120 'mpg' => 'video/mpeg' , 2121 'mpe' => 'video/mpeg' , 2122 'qt' => 'video/quicktime' , 2123 'mov' => 'video/quicktime' , 2124 'avi' => 'video/x-msvideo' , 2125 'movie' => 'video/x-sgi-movie' , 2126 'doc' => 'application/msword' , 2127 'word' => 'application/msword' , 2128 'xl' => 'application/excel' , 2129 'eml' => 'message/rfc822' 2130 ); 2131 return (!isset ($mimes [strtolower ($ext )])) ? 'application/octet-stream' : $mimes [strtolower ($ext )]; 2132 } 2133 2134 /** 2135 * Set (or reset) Class Objects (variables) 2136 * 2137 * Usage Example: 2138 * $page->set('X-Priority', '3'); 2139 * 2140 * @access public 2141 * @param string $name Parameter Name 2142 * @param mixed $value Parameter Value 2143 * NOTE: will not work with arrays, there are no arrays to set/reset 2144 * @todo Should this not be using __set() magic function? 2145 */ 2146 public function set ($name , $value = '') { 2147 try { 2148 if (isset ($this ->$name ) ) { 2149 $this ->$name = $value ; 2150 } else { 2151 throw new phpmailerException ($this ->Lang ('variable_set' ) . $name , self :: STOP_CRITICAL); 2152 } 2153 } catch (Exception $e) { F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-phpmailer.php: 27/30

2154 $this ->SetError ($e->getMessage ()); 2155 if ($e->getCode () == self :: STOP_CRITICAL) { 2156 return false ; 2157 } 2158 } 2159 return true ; 2160 } 2161 2162 /** 2163 * Strips newlines to prevent header injection. 2164 * @access public 2165 * @param string $str String 2166 * @return string 2167 */ 2168 public function SecureHeader ($str ) { 2169 $str = str_replace ("\r" , '', $str ); 2170 $str = str_replace ("\n" , '', $str ); 2171 return trim ($str ); 2172 } 2173 2174 /** 2175 * Set the private key file and password to sign the message. 2176 * 2177 * @access public 2178 * @param string $key_filename Parameter File Name 2179 * @param string $key_pass Password for private key 2180 */ 2181 public function Sign ($cert_filename , $key_filename , $key_pass ) { 2182 $this ->sign_cert_file = $cert_filename ; 2183 $this ->sign_key_file = $key_filename ; 2184 $this ->sign_key_pass = $key_pass ; 2185 } 2186 2187 /** 2188 * Set the private key file and password to sign the message. 2189 * 2190 * @access public 2191 * @param string $key_filename Parameter File Name 2192 * @param string $key_pass Password for private key 2193 */ 2194 public function DKIM_QP($txt ) { 2195 $tmp ="" ; 2196 $line ="" ; 2197 for ($i=0;$i=')); 360 361 /** 362 * No file source 363 */ 364 define('SIMPLEPIE_FILE_SOURCE_NONE', 0); 365 366 /** 367 * Remote file source 368 */ 369 define('SIMPLEPIE_FILE_SOURCE_REMOTE', 1); 370 371 /** 372 * Local file source 373 */ 374 define('SIMPLEPIE_FILE_SOURCE_LOCAL', 2); 375 376 /** 377 * fsockopen() file source 378 */ 379 define('SIMPLEPIE_FILE_SOURCE_FSOCKOPEN', 4); 380 381 /** 382 * cURL file source 383 */ 384 define('SIMPLEPIE_FILE_SOURCE_CURL', 8); 385 386 /** 387 * file_get_contents() file source 388 */ 389 define('SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS', 16); 390 391 /** 392 * SimplePie 393 * 394 * @package SimplePie 395 */ 396 class SimplePie F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-simplepie.php: 5/192

397 { 398 /** 399 * @var array Raw data 400 * @access private 401 */ 402 var $data = array(); 403 404 /** 405 * @var mixed Error string 406 * @access private 407 */ 408 var $error; 409 410 /** 411 * @var object Instance of SimplePie_Sanitize (or other class) 412 * @see SimplePie::set_sanitize_class() 413 * @access private 414 */ 415 var $sanitize; 416 417 /** 418 * @var string SimplePie Useragent 419 * @see SimplePie::set_useragent() 420 * @access private 421 */ 422 var $useragent = SIMPLEPIE_USERAGENT; 423 424 /** 425 * @var string Feed URL 426 * @see SimplePie::set_feed_url() 427 * @access private 428 */ 429 var $feed_url; 430 431 /** 432 * @var object Instance of SimplePie_File to use as a feed 433 * @see SimplePie::set_file() 434 * @access private 435 */ 436 var $file; 437 438 /** 439 * @var string Raw feed data 440 * @see SimplePie::set_raw_data() 441 * @access private 442 */ 443 var $raw_data; 444 445 /** 446 * @var int Timeout for fetching remote files 447 * @see SimplePie::set_timeout() 448 * @access private 449 */ 450 var $timeout = 10; 451 452 /** 453 * @var bool Forces fsockopen() to be used for remote files instead 454 * of cURL, even if a new enough version is installed 455 * @see SimplePie::force_fsockopen() 456 * @access private 457 */ 458 var $force_fsockopen = false; 459 460 /** 461 * @var bool Force the given data/URL to be treated as a feed no matter what 462 * it appears like 463 * @see SimplePie::force_feed() 464 * @access private 465 */ 466 var $force_feed = false; 467 468 /** 469 * @var bool Enable/Disable XML dump 470 * @see SimplePie::enable_xml_dump() 471 * @access private 472 */ 473 var $xml_dump = false; 474 475 /** 476 * @var bool Enable/Disable Caching F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-simplepie.php: 6/192

477 * @see SimplePie::enable_cache() 478 * @access private 479 */ 480 var $cache = true; 481 482 /** 483 * @var int Cache duration (in seconds) 484 * @see SimplePie::set_cache_duration() 485 * @access private 486 */ 487 var $cache_duration = 3600; 488 489 /** 490 * @var int Auto-discovery cache duration (in seconds) 491 * @see SimplePie::set_autodiscovery_cache_duration() 492 * @access private 493 */ 494 var $autodiscovery_cache_duration = 604800; // 7 Days. 495 496 /** 497 * @var string Cache location (relative to executing script) 498 * @see SimplePie::set_cache_location() 499 * @access private 500 */ 501 var $cache_location = './cache'; 502 503 /** 504 * @var string Function that creates the cache filename 505 * @see SimplePie::set_cache_name_function() 506 * @access private 507 */ 508 var $cache_name_function = 'md5'; 509 510 /** 511 * @var bool Reorder feed by date descending 512 * @see SimplePie::enable_order_by_date() 513 * @access private 514 */ 515 var $order_by_date = true; 516 517 /** 518 * @var mixed Force input encoding to be set to the follow value 519 * (false, or anything type-cast to false, disables this feature) 520 * @see SimplePie::set_input_encoding() 521 * @access private 522 */ 523 var $input_encoding = false; 524 525 /** 526 * @var int Feed Autodiscovery Level 527 * @see SimplePie::set_autodiscovery_level() 528 * @access private 529 */ 530 var $autodiscovery = SIMPLEPIE_LOCATOR_ALL; 531 532 /** 533 * @var string Class used for caching feeds 534 * @see SimplePie::set_cache_class() 535 * @access private 536 */ 537 var $cache_class = 'SimplePie_Cache'; 538 539 /** 540 * @var string Class used for locating feeds 541 * @see SimplePie::set_locator_class() 542 * @access private 543 */ 544 var $locator_class = 'SimplePie_Locator'; 545 546 /** 547 * @var string Class used for parsing feeds 548 * @see SimplePie::set_parser_class() 549 * @access private 550 */ 551 var $parser_class = 'SimplePie_Parser'; 552 553 /** 554 * @var string Class used for fetching feeds 555 * @see SimplePie::set_file_class() 556 * @access private F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-simplepie.php: 7/192

557 */ 558 var $file_class = 'SimplePie_File'; 559 560 /** 561 * @var string Class used for items 562 * @see SimplePie::set_item_class() 563 * @access private 564 */ 565 var $item_class = 'SimplePie_Item'; 566 567 /** 568 * @var string Class used for authors 569 * @see SimplePie::set_author_class() 570 * @access private 571 */ 572 var $author_class = 'SimplePie_Author'; 573 574 /** 575 * @var string Class used for categories 576 * @see SimplePie::set_category_class() 577 * @access private 578 */ 579 var $category_class = 'SimplePie_Category'; 580 581 /** 582 * @var string Class used for enclosures 583 * @see SimplePie::set_enclosures_class() 584 * @access private 585 */ 586 var $enclosure_class = 'SimplePie_Enclosure'; 587 588 /** 589 * @var string Class used for Media RSS captions 590 * @see SimplePie::set_caption_class() 591 * @access private 592 */ 593 var $caption_class = 'SimplePie_Caption'; 594 595 /** 596 * @var string Class used for Media RSS 597 * @see SimplePie::set_copyright_class() 598 * @access private 599 */ 600 var $copyright_class = 'SimplePie_Copyright'; 601 602 /** 603 * @var string Class used for Media RSS 604 * @see SimplePie::set_credit_class() 605 * @access private 606 */ 607 var $credit_class = 'SimplePie_Credit'; 608 609 /** 610 * @var string Class used for Media RSS 611 * @see SimplePie::set_rating_class() 612 * @access private 613 */ 614 var $rating_class = 'SimplePie_Rating'; 615 616 /** 617 * @var string Class used for Media RSS 618 * @see SimplePie::set_restriction_class() 619 * @access private 620 */ 621 var $restriction_class = 'SimplePie_Restriction'; 622 623 /** 624 * @var string Class used for content-type sniffing 625 * @see SimplePie::set_content_type_sniffer_class() 626 * @access private 627 */ 628 var $content_type_sniffer_class = 'SimplePie_Content_Type_Sniffer'; 629 630 /** 631 * @var string Class used for item sources. 632 * @see SimplePie::set_source_class() 633 * @access private 634 */ 635 var $source_class = 'SimplePie_Source'; 636 F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-simplepie.php: 8/192

637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712

/** * @var mixed Set javascript query string parameter (false, or * anything type-cast to false, disables this feature) * @see SimplePie::set_javascript() * @access private */ var $javascript = 'js'; /** * @var int Maximum number of feeds to check with autodiscovery * @see SimplePie::set_max_checked_feeds() * @access private */ var $max_checked_feeds = 10; /** * @var array All the feeds found during the autodiscovery process * @see SimplePie::get_all_discovered_feeds() * @access private */ var $all_discovered_feeds = array(); /** * @var string Web-accessible path to the handler_favicon.php file. * @see SimplePie::set_favicon_handler() * @access private */ var $favicon_handler = ''; /** * @var string Web-accessible path to the handler_image.php file. * @see SimplePie::set_image_handler() * @access private */ var $image_handler = ''; /** * @var array Stores the URLs when multiple feeds are being initialized. * @see SimplePie::set_feed_url() * @access private */ var $multifeed_url = array(); /** * @var array Stores SimplePie objects when multiple feeds initialized. * @access private */ var $multifeed_objects = array(); /** * @var array Stores the get_object_vars() array for use with multifeeds. * @see SimplePie::set_feed_url() * @access private */ var $config_settings = null; /** * @var integer Stores the number of items to return per-feed with multifeeds. * @see SimplePie::set_item_limit() * @access private */ var $item_limit = 0; /** * @var array Stores the default attributes to be stripped by strip_attributes(). * @see SimplePie::strip_attributes() * @access private */ var $strip_attributes = array('bgsound', 'class', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur' , 'lowsrc', 'dynsrc'); /** * @var array Stores the default tags to be stripped by strip_htmltags(). * @see SimplePie::strip_htmltags() * @access private */ var $strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', ' noscript', 'object', 'param', 'script', 'style');

713 714 /** F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-simplepie.php: 9/192

715 * The SimplePie class contains feed level data and options 716 * 717 * There are two ways that you can create a new SimplePie object. The first 718 * is by passing a feed URL as a parameter to the SimplePie constructor 719 * (as well as optionally setting the cache location and cache expiry). This 720 * will initialise the whole feed with all of the default settings, and you 721 * can begin accessing methods and properties immediately. 722 * 723 * The second way is to create the SimplePie object with no parameters 724 * at all. This will enable you to set configuration options. After setting 725 * them, you must initialise the feed using $feed->init(). At that point the 726 * object's methods and properties will be available to you. This format is 727 * what is used throughout this documentation. 728 * 729 * @access public 730 * @since 1.0 Preview Release 731 * @param string $feed_url This is the URL you want to parse. 732 * @param string $cache_location This is where you want the cache to be stored. 733 * @param int $cache_duration This is the number of seconds that you want to store the cache file for. 734 */ 735 function SimplePie($feed_url = null, $cache_location = null, $cache_duration = null) 736 { 737 // Other objects, instances created here so we can set options on them 738 $this->sanitize =& new SimplePie_Sanitize; 739 740 // Set options if they're passed to the constructor 741 if ($cache_location !== null) 742 { 743 $this->set_cache_location($cache_location); 744 } 745 746 if ($cache_duration !== null) 747 { 748 $this->set_cache_duration($cache_duration); 749 } 750 751 // Only init the script if we're passed a feed URL 752 if ($feed_url !== null) 753 { 754 $this->set_feed_url($feed_url); 755 $this->init(); 756 } 757 } 758 759 /** 760 * Used for converting object to a string 761 */ 762 function __toString() 763 { 764 return md5(serialize($this->data)); 765 } 766 767 /** 768 * Remove items that link back to this before destroying this object 769 */ 770 function __destruct() 771 { 772 if ((version_compare(PHP_VERSION, '5.3', 'timeout = (int) $timeout; 886 } 887 888 /** 889 * Forces SimplePie to use fsockopen() instead of the preferred cURL 890 * functions. 891 * 892 * @access public 893 * @since 1.0 Beta 3 894 * @param bool $enable Force fsockopen() to be used 895 */ 896 function force_fsockopen($enable = false) 897 { 898 $this->force_fsockopen = (bool) $enable; 899 } 900 901 /** 902 * Outputs the raw XML content of the feed, after it has gone through 903 * SimplePie's filters. 904 * 905 * Used only for debugging, this function will output the XML content as 906 * text/xml. When SimplePie reads in a feed, it does a bit of cleaning up 907 * before trying to parse it. Many parts of the feed are re-written in 908 * memory, and in the end, you have a parsable feed. XML dump shows you the 909 * actual XML that SimplePie tries to parse, which may or may not be very 910 * different from the original feed. 911 * 912 * @access public 913 * @since 1.0 Preview Release 914 * @param bool $enable Enable XML dump 915 */ 916 function enable_xml_dump($enable = false) 917 { 918 $this->xml_dump = (bool) $enable; 919 } 920 921 /** 922 * Enables/disables caching in SimplePie. 923 * 924 * This option allows you to disable caching all-together in SimplePie. 925 * However, disabling the cache can lead to longer load times. 926 * 927 * @access public 928 * @since 1.0 Preview Release 929 * @param bool $enable Enable caching 930 */ 931 function enable_cache($enable = true) 932 { 933 $this->cache = (bool) $enable; 934 } 935 936 /** 937 * Set the length of time (in seconds) that the contents of a feed 938 * will be cached. 939 * 940 * @access public 941 * @param int $seconds The feed content cache duration. 942 */ 943 function set_cache_duration($seconds = 3600) 944 { 945 $this->cache_duration = (int) $seconds; 946 } 947 948 /** 949 * Set the length of time (in seconds) that the autodiscovered feed 950 * URL will be cached. 951 * 952 * @access public 953 * @param int $seconds The autodiscovered feed URL cache duration. 954 */ F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-simplepie.php: 12/192

955 function set_autodiscovery_cache_duration($seconds = 604800) 956 { 957 $this->autodiscovery_cache_duration = (int) $seconds; 958 } 959 960 /** 961 * Set the file system location where the cached files should be stored. 962 * 963 * @access public 964 * @param string $location The file system location. 965 */ 966 function set_cache_location($location = './cache') 967 { 968 $this->cache_location = (string) $location; 969 } 970 971 /** 972 * Determines whether feed items should be sorted into reverse chronological order. 973 * 974 * @access public 975 * @param bool $enable Sort as reverse chronological order. 976 */ 977 function enable_order_by_date($enable = true) 978 { 979 $this->order_by_date = (bool) $enable; 980 } 981 982 /** 983 * Allows you to override the character encoding reported by the feed. 984 * 985 * @access public 986 * @param string $encoding Character encoding. 987 */ 988 function set_input_encoding($encoding = false) 989 { 990 if ($encoding) 991 { 992 $this->input_encoding = (string) $encoding; 993 } 994 else 995 { 996 $this->input_encoding = false; 997 } 998 } 999 1000 /** 1001 * Set how much feed autodiscovery to do 1002 * 1003 * @access public 1004 * @see SIMPLEPIE_LOCATOR_NONE 1005 * @see SIMPLEPIE_LOCATOR_AUTODISCOVERY 1006 * @see SIMPLEPIE_LOCATOR_LOCAL_EXTENSION 1007 * @see SIMPLEPIE_LOCATOR_LOCAL_BODY 1008 * @see SIMPLEPIE_LOCATOR_REMOTE_EXTENSION 1009 * @see SIMPLEPIE_LOCATOR_REMOTE_BODY 1010 * @see SIMPLEPIE_LOCATOR_ALL 1011 * @param int $level Feed Autodiscovery Level (level can be a 1012 * combination of the above constants, see bitwise OR operator) 1013 */ 1014 function set_autodiscovery_level($level = SIMPLEPIE_LOCATOR_ALL) 1015 { 1016 $this->autodiscovery = (int) $level; 1017 } 1018 1019 /** 1020 * Allows you to change which class SimplePie uses for caching. 1021 * Useful when you are overloading or extending SimplePie's default classes. 1022 * 1023 * @access public 1024 * @param string $class Name of custom class. 1025 * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation 1026 * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation 1027 */ 1028 function set_cache_class($class = 'SimplePie_Cache') 1029 { 1030 if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Cache')) 1031 { 1032 $this->cache_class = $class; 1033 return true; 1034 } F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-simplepie.php: 13/192

1035 return false; 1036 } 1037 1038 /** 1039 * Allows you to change which class SimplePie uses for auto-discovery. 1040 * Useful when you are overloading or extending SimplePie's default classes. 1041 * 1042 * @access public 1043 * @param string $class Name of custom class. 1044 * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation 1045 * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation 1046 */ 1047 function set_locator_class($class = 'SimplePie_Locator') 1048 { 1049 if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Locator')) 1050 { 1051 $this->locator_class = $class; 1052 return true; 1053 } 1054 return false; 1055 } 1056 1057 /** 1058 * Allows you to change which class SimplePie uses for XML parsing. 1059 * Useful when you are overloading or extending SimplePie's default classes. 1060 * 1061 * @access public 1062 * @param string $class Name of custom class. 1063 * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation 1064 * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation 1065 */ 1066 function set_parser_class($class = 'SimplePie_Parser') 1067 { 1068 if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Parser')) 1069 { 1070 $this->parser_class = $class; 1071 return true; 1072 } 1073 return false; 1074 } 1075 1076 /** 1077 * Allows you to change which class SimplePie uses for remote file fetching. 1078 * Useful when you are overloading or extending SimplePie's default classes. 1079 * 1080 * @access public 1081 * @param string $class Name of custom class. 1082 * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation 1083 * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation 1084 */ 1085 function set_file_class($class = 'SimplePie_File') 1086 { 1087 if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_File')) 1088 { 1089 $this->file_class = $class; 1090 return true; 1091 } 1092 return false; 1093 } 1094 1095 /** 1096 * Allows you to change which class SimplePie uses for data sanitization. 1097 * Useful when you are overloading or extending SimplePie's default classes. 1098 * 1099 * @access public 1100 * @param string $class Name of custom class. 1101 * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation 1102 * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation 1103 */ 1104 function set_sanitize_class($class = 'SimplePie_Sanitize') 1105 { 1106 if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Sanitize')) 1107 { 1108 $this->sanitize =& new $class; 1109 return true; 1110 } 1111 return false; 1112 } 1113 1114 /** F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-simplepie.php: 14/192

1115 * Allows you to change which class SimplePie uses for handling feed items. 1116 * Useful when you are overloading or extending SimplePie's default classes. 1117 * 1118 * @access public 1119 * @param string $class Name of custom class. 1120 * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation 1121 * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation 1122 */ 1123 function set_item_class($class = 'SimplePie_Item') 1124 { 1125 if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Item')) 1126 { 1127 $this->item_class = $class; 1128 return true; 1129 } 1130 return false; 1131 } 1132 1133 /** 1134 * Allows you to change which class SimplePie uses for handling author data. 1135 * Useful when you are overloading or extending SimplePie's default classes. 1136 * 1137 * @access public 1138 * @param string $class Name of custom class. 1139 * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation 1140 * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation 1141 */ 1142 function set_author_class($class = 'SimplePie_Author') 1143 { 1144 if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Author')) 1145 { 1146 $this->author_class = $class; 1147 return true; 1148 } 1149 return false; 1150 } 1151 1152 /** 1153 * Allows you to change which class SimplePie uses for handling category data. 1154 * Useful when you are overloading or extending SimplePie's default classes. 1155 * 1156 * @access public 1157 * @param string $class Name of custom class. 1158 * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation 1159 * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation 1160 */ 1161 function set_category_class($class = 'SimplePie_Category') 1162 { 1163 if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Category')) 1164 { 1165 $this->category_class = $class; 1166 return true; 1167 } 1168 return false; 1169 } 1170 1171 /** 1172 * Allows you to change which class SimplePie uses for feed enclosures. 1173 * Useful when you are overloading or extending SimplePie's default classes. 1174 * 1175 * @access public 1176 * @param string $class Name of custom class. 1177 * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation 1178 * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation 1179 */ 1180 function set_enclosure_class($class = 'SimplePie_Enclosure') 1181 { 1182 if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Enclosure')) 1183 { 1184 $this->enclosure_class = $class; 1185 return true; 1186 } 1187 return false; 1188 } 1189 1190 /** 1191 * Allows you to change which class SimplePie uses for captions 1192 * Useful when you are overloading or extending SimplePie's default classes. 1193 * 1194 * @access public F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-simplepie.php: 15/192

1195 * @param string $class Name of custom class. 1196 * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation 1197 * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation 1198 */ 1199 function set_caption_class($class = 'SimplePie_Caption') 1200 { 1201 if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Caption')) 1202 { 1203 $this->caption_class = $class; 1204 return true; 1205 } 1206 return false; 1207 } 1208 1209 /** 1210 * Allows you to change which class SimplePie uses for 1211 * Useful when you are overloading or extending SimplePie's default classes. 1212 * 1213 * @access public 1214 * @param string $class Name of custom class. 1215 * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation 1216 * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation 1217 */ 1218 function set_copyright_class($class = 'SimplePie_Copyright') 1219 { 1220 if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Copyright')) 1221 { 1222 $this->copyright_class = $class; 1223 return true; 1224 } 1225 return false; 1226 } 1227 1228 /** 1229 * Allows you to change which class SimplePie uses for 1230 * Useful when you are overloading or extending SimplePie's default classes. 1231 * 1232 * @access public 1233 * @param string $class Name of custom class. 1234 * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation 1235 * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation 1236 */ 1237 function set_credit_class($class = 'SimplePie_Credit') 1238 { 1239 if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Credit')) 1240 { 1241 $this->credit_class = $class; 1242 return true; 1243 } 1244 return false; 1245 } 1246 1247 /** 1248 * Allows you to change which class SimplePie uses for 1249 * Useful when you are overloading or extending SimplePie's default classes. 1250 * 1251 * @access public 1252 * @param string $class Name of custom class. 1253 * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation 1254 * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation 1255 */ 1256 function set_rating_class($class = 'SimplePie_Rating') 1257 { 1258 if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Rating')) 1259 { 1260 $this->rating_class = $class; 1261 return true; 1262 } 1263 return false; 1264 } 1265 1266 /** 1267 * Allows you to change which class SimplePie uses for 1268 * Useful when you are overloading or extending SimplePie's default classes. 1269 * 1270 * @access public 1271 * @param string $class Name of custom class. 1272 * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation 1273 * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation 1274 */ F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-simplepie.php: 16/192

1275 function set_restriction_class($class = 'SimplePie_Restriction') 1276 { 1277 if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Restriction')) 1278 { 1279 $this->restriction_class = $class; 1280 return true; 1281 } 1282 return false; 1283 } 1284 1285 /** 1286 * Allows you to change which class SimplePie uses for content-type sniffing. 1287 * Useful when you are overloading or extending SimplePie's default classes. 1288 * 1289 * @access public 1290 * @param string $class Name of custom class. 1291 * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation 1292 * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation 1293 */ 1294 function set_content_type_sniffer_class($class = 'SimplePie_Content_Type_Sniffer') 1295 { 1296 if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Content_Type_Sniffer')) 1297 { 1298 $this->content_type_sniffer_class = $class; 1299 return true; 1300 } 1301 return false; 1302 } 1303 1304 /** 1305 * Allows you to change which class SimplePie uses item sources. 1306 * Useful when you are overloading or extending SimplePie's default classes. 1307 * 1308 * @access public 1309 * @param string $class Name of custom class. 1310 * @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation 1311 * @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation 1312 */ 1313 function set_source_class($class = 'SimplePie_Source') 1314 { 1315 if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Source')) 1316 { 1317 $this->source_class = $class; 1318 return true; 1319 } 1320 return false; 1321 } 1322 1323 /** 1324 * Allows you to override the default user agent string. 1325 * 1326 * @access public 1327 * @param string $ua New user agent string. 1328 */ 1329 function set_useragent($ua = SIMPLEPIE_USERAGENT) 1330 { 1331 $this->useragent = (string) $ua; 1332 } 1333 1334 /** 1335 * Set callback function to create cache filename with 1336 * 1337 * @access public 1338 * @param mixed $function Callback function 1339 */ 1340 function set_cache_name_function($function = 'md5') 1341 { 1342 if (is_callable($function)) 1343 { 1344 $this->cache_name_function = $function; 1345 } 1346 } 1347 1348 /** 1349 * Set javascript query string parameter 1350 * 1351 * @access public 1352 * @param mixed $get Javascript query string parameter 1353 */ 1354 function set_javascript($get = 'js') F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-simplepie.php: 17/192

1355 { 1356 if ($get) 1357 { 1358 $this->javascript = (string) $get; 1359 } 1360 else 1361 { 1362 $this->javascript = false; 1363 } 1364 } 1365 1366 /** 1367 * Set options to make SP as fast as possible. Forgoes a 1368 * substantial amount of data sanitization in favor of speed. 1369 * 1370 * @access public 1371 * @param bool $set Whether to set them or not 1372 */ 1373 function set_stupidly_fast($set = false) 1374 { 1375 if ($set) 1376 { 1377 $this->enable_order_by_date(false); 1378 $this->remove_div(false); 1379 $this->strip_comments(false); 1380 $this->strip_htmltags(false); 1381 $this->strip_attributes(false); 1382 $this->set_image_handler(false); 1383 } 1384 } 1385 1386 /** 1387 * Set maximum number of feeds to check with autodiscovery 1388 * 1389 * @access public 1390 * @param int $max Maximum number of feeds to check 1391 */ 1392 function set_max_checked_feeds($max = 10) 1393 { 1394 $this->max_checked_feeds = (int) $max; 1395 } 1396 1397 function remove_div($enable = true) 1398 { 1399 $this->sanitize->remove_div($enable); 1400 } 1401 1402 function strip_htmltags($tags = '', $encode = null) 1403 { 1404 if ($tags === '') 1405 { 1406 $tags = $this->strip_htmltags; 1407 } 1408 $this->sanitize->strip_htmltags($tags); 1409 if ($encode !== null) 1410 { 1411 $this->sanitize->encode_instead_of_strip($tags); 1412 } 1413 } 1414 1415 function encode_instead_of_strip($enable = true) 1416 { 1417 $this->sanitize->encode_instead_of_strip($enable); 1418 } 1419 1420 function strip_attributes($attribs = '') 1421 { 1422 if ($attribs === '') 1423 { 1424 $attribs = $this->strip_attributes; 1425 } 1426 $this->sanitize->strip_attributes($attribs); 1427 } 1428 1429 function set_output_encoding($encoding = 'UTF-8') 1430 { 1431 $this->sanitize->set_output_encoding($encoding); 1432 } 1433 1434 function strip_comments($strip = false) F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-simplepie.php: 18/192

/** * Set element/attribute key/value pairs of HTML attributes * containing URLs that need to be resolved relative to the feed * * @access public * @since 1.0 * @param array $element_attribute Element/attribute key/value pairs */ function set_url_replacements($element_attribute = array('a' => 'href', 'area' => 'href', 'blockquote' => 'cite', 'del' => 'cite', 'form' => 'action', 'i mg' => array('longdesc', 'src'), 'input' => 'src', 'ins' => 'cite', 'q' => 'cite')) 1448 { 1449 $this->sanitize->set_url_replacements($element_attribute); 1450 } 1451 1452 /** 1453 * Set the handler to enable the display of cached favicons. 1454 * 1455 * @access public 1456 * @param str $page Web-accessible path to the handler_favicon.php file. 1457 * @param str $qs The query string that the value should be passed to. 1458 */ 1459 function set_favicon_handler($page = false, $qs = 'i') 1460 { 1461 if ($page !== false) 1462 { 1463 $this->favicon_handler = $page . '?' . $qs . '='; 1464 } 1465 else 1466 { 1467 $this->favicon_handler = ''; 1468 } 1469 } 1470 1471 /** 1472 * Set the handler to enable the display of cached images. 1473 * 1474 * @access public 1475 * @param str $page Web-accessible path to the handler_image.php file. 1476 * @param str $qs The query string that the value should be passed to. 1477 */ 1478 function set_image_handler($page = false, $qs = 'i') 1479 { 1480 if ($page !== false) 1481 { 1482 $this->sanitize->set_image_handler($page . '?' . $qs . '='); 1483 } 1484 else 1485 { 1486 $this->image_handler = ''; 1487 } 1488 } 1489 1490 /** 1491 * Set the limit for items returned per-feed with multifeeds. 1492 * 1493 * @access public 1494 * @param integer $limit The maximum number of items to return. 1495 */ 1496 function set_item_limit($limit = 0) 1497 { 1498 $this->item_limit = (int) $limit; 1499 } 1500 1501 function init() 1502 { 1503 // Check absolute bare minimum requirements. 1504 if ((function_exists('version_compare') && version_compare(PHP_VERSION, '4.3.0', 'sanitize->strip_comments($strip); }

if ($this->feed_url !== null) { $parsed_feed_url = SimplePie_Misc::parse_url($this->feed_url); // Decide whether to enable caching if ($this->cache && $parsed_feed_url['scheme'] !== '') { $cache = call_user_func(array($this->cache_class, 'create'), $this->cache_location, call_user_func($this->cache_name_function, $this->feed_url), 'spc'); 1548 } 1549 // If it's enabled and we don't want an XML dump, use the cache 1550 if ($cache && !$this->xml_dump) 1551 { 1552 // Load the Cache 1553 $this->data = $cache->load(); 1554 if (!empty($this->data)) 1555 { 1556 // If the cache is for an outdated build of SimplePie 1557 if (!isset($this->data['build']) || $this->data['build'] !== SIMPLEPIE_BUILD) 1558 { 1559 $cache->unlink(); 1560 $this->data = array(); 1561 } 1562 // If we've hit a collision just rerun it with caching disabled 1563 elseif (isset($this->data['url']) && $this->data['url'] !== $this->feed_url) 1564 { 1565 $cache = false; 1566 $this->data = array(); 1567 } 1568 // If we've got a non feed_url stored (if the page isn't actually a feed, or is a redirect) use that URL. 1569 elseif (isset($this->data['feed_url'])) 1570 { 1571 // If the autodiscovery cache is still valid use it. 1572 if ($cache->mtime() + $this->autodiscovery_cache_duration > time()) 1573 { 1574 // Do not need to do feed autodiscovery yet. 1575 if ($this->data['feed_url'] === $this->data['url']) 1576 { 1577 $cache->unlink(); 1578 $this->data = array(); 1579 } 1580 else 1581 { 1582 $this->set_feed_url($this->data['feed_url']); 1583 return $this->init(); 1584 } 1585 } 1586 } 1587 // Check if the cache has been updated 1588 elseif ($cache->mtime() + $this->cache_duration < time()) 1589 { 1590 // If we have last-modified and/or etag set F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-simplepie.php: 20/192

1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547

if ($xml_is_sane === null) { $parser_check = xml_parser_create(); xml_parse_into_struct($parser_check, '&', $values); xml_parser_free($parser_check); $xml_is_sane = isset($values[0]['value']); } if (!$xml_is_sane) { return false; } } if (isset($_GET[$this->javascript])) { SimplePie_Misc::output_javascript(); exit; } // Pass whatever was set with config options over to the sanitizer. $this->sanitize->pass_cache_data($this->cache, $this->cache_location, $this->cache_name_function, $this->cache_class); $this->sanitize->pass_file_data($this->file_class, $this->timeout, $this->useragent, $this->force_fsockopen); if ($this->feed_url !== null || $this->raw_data !== null) { $this->data = array(); $this->multifeed_objects = array(); $cache = false;

1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663

if (isset($this->data['headers']['last-modified']) || isset($this->data['headers']['etag'])) { $headers = array(); if (isset($this->data['headers']['last-modified'])) { $headers['if-modified-since'] = $this->data['headers']['last-modified']; } if (isset($this->data['headers']['etag'])) { $headers['if-none-match'] = '"' . $this->data['headers']['etag'] . '"'; } $file =& new $this->file_class($this->feed_url, $this->timeout/10, 5, $headers, $this->useragent, $this->force_fsockopen); if ($file->success) { if ($file->status_code === 304) { $cache->touch(); return true; } else { $headers = $file->headers; } } else { unset($file); } } } // If the cache is still valid, just return true else { return true; } } // If the cache is empty, delete it else { $cache->unlink(); $this->data = array(); } } // If we don't already have the file (it'll only exist if we've opened it to check if the cache has been modified), open it. if (!isset($file)) { if (is_a($this->file, 'SimplePie_File') && $this->file->url === $this->feed_url) { $file =& $this->file; } else { $file =& new $this->file_class($this->feed_url, $this->timeout, 5, null, $this->useragent, $this->force_fsockopen); } } // If the file connection has an error, set SimplePie::error to that and quit if (!$file->success && !($file->method & SIMPLEPIE_FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status _code > 206 && $file->status_code < 300))) { $this->error = $file->error; if (!empty($this->data)) { return true; } else { return false; } }

if (!$this->force_feed) { // Check if the supplied URL is a feed, if it isn't, look for it. $locate =& new $this->locator_class($file, $this->timeout, $this->useragent, $this->file_class, $this->max_checked_feeds, $this-> content_type_sniffer_class); 1664 if (!$locate->is_feed($file)) 1665 { 1666 // We need to unset this so that if SimplePie::set_file() has been called that object is untouched 1667 unset($file); 1668 if ($file = $locate->find($this->autodiscovery, $this->all_discovered_feeds)) F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-simplepie.php: 21/192

1669 1670 1671 1672 1673 1674 1675 1676 1677

{ if ($cache) { $this->data = array('url' => $this->feed_url, 'feed_url' => $file->url, 'build' => SIMPLEPIE_BUILD); if (!$cache->save($this)) { trigger_error("$this->cache_location is not writeable", E_USER_WARNING); } $cache = call_user_func(array($this->cache_class, 'create'), $this->cache_location, call_user_func($this->cache_name_f unction, $file->url), 'spc'); } $this->feed_url = $file->url; } else { $this->error = "A feed could not be found at $this->feed_url"; SimplePie_Misc::error($this->error, E_USER_NOTICE, __FILE__, __LINE__); return false; } } $locate = null; }

1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 $headers = $file->headers; 1692 $data = $file->body; 1693 $sniffer =& new $this->content_type_sniffer_class($file); 1694 $sniffed = $sniffer->get_type(); 1695 } 1696 else 1697 { 1698 $data = $this->raw_data; 1699 } 1700 1701 // Set up array of possible encodings 1702 $encodings = array(); 1703 1704 // First check to see if input has been overridden. 1705 if ($this->input_encoding !== false) 1706 { 1707 $encodings[] = $this->input_encoding; 1708 } 1709 1710 $application_types = array('application/xml', 'application/xml-dtd', 'application/xml-external-parsed-entity'); 1711 $text_types = array('text/xml', 'text/xml-external-parsed-entity'); 1712 1713 // RFC 3023 (only applies to sniffed content) 1714 if (isset($sniffed)) 1715 { 1716 if (in_array($sniffed, $application_types) || substr($sniffed, 0, 12) === 'application/' && substr($sniffed, -4) === '+xml') 1717 { 1718 if (isset($headers['content-type']) && preg_match('/;\x20?charset=([^;]*)/i', $headers['content-type'], $charset)) 1719 { 1720 $encodings[] = strtoupper($charset[1]); 1721 } 1722 $encodings = array_merge($encodings, SimplePie_Misc::xml_encoding($data)); 1723 $encodings[] = 'UTF-8'; 1724 } 1725 elseif (in_array($sniffed, $text_types) || substr($sniffed, 0, 5) === 'text/' && substr($sniffed, -4) === '+xml') 1726 { 1727 if (isset($headers['content-type']) && preg_match('/;\x20?charset=([^;]*)/i', $headers['content-type'], $charset)) 1728 { 1729 $encodings[] = $charset[1]; 1730 } 1731 $encodings[] = 'US-ASCII'; 1732 } 1733 // Text MIME-type default 1734 elseif (substr($sniffed, 0, 5) === 'text/') 1735 { 1736 $encodings[] = 'US-ASCII'; 1737 } 1738 } 1739 1740 // Fallback to XML 1.0 Appendix F.1/UTF-8/ISO-8859-1 1741 $encodings = array_merge($encodings, SimplePie_Misc::xml_encoding($data)); 1742 $encodings[] = 'UTF-8'; 1743 $encodings[] = 'ISO-8859-1'; 1744 1745 // There's no point in trying an encoding twice 1746 $encodings = array_unique($encodings); 1747 F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-simplepie.php: 22/192

} if(isset($parser)) { // We have an error, just set SimplePie_Misc::error to it and quit $this->error = sprintf('XML error: %s at line %d, column %d', $parser->get_error_string(), $parser->get_current_line(), $parser->get_ current_column()); 1797 } 1798 else 1799 { 1800 $this->error = 'The data could not be converted to UTF-8'; 1801 } 1802 SimplePie_Misc::error($this->error, E_USER_NOTICE, __FILE__, __LINE__); 1803 return false; 1804 } 1805 elseif (!empty($this->multifeed_url)) 1806 { 1807 $i = 0; 1808 $success = 0; 1809 $this->multifeed_objects = array(); 1810 foreach ($this->multifeed_url as $url) 1811 { 1812 if (SIMPLEPIE_PHP5) 1813 { 1814 // This keyword needs to defy coding standards for PHP4 compatibility 1815 $this->multifeed_objects[$i] = clone($this); 1816 } 1817 else 1818 { 1819 $this->multifeed_objects[$i] = $this; 1820 } 1821 $this->multifeed_objects[$i]->set_feed_url($url); 1822 $success |= $this->multifeed_objects[$i]->init(); 1823 $i++; 1824 } 1825 return (bool) $success; 1826 } F:\TrabajoEduardo\Pginas Web\EVIANA\Respaldo\wp-includes\class-simplepie.php: 23/192

1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796

// If we want the XML, just output that with the most likely encoding and quit if ($this->xml_dump) { header('Content-type: text/xml; charset=' . $encodings[0]); echo $data; exit; } // Loop through each possible encoding, till we return something, or run out of possibilities foreach ($encodings as $encoding) { // Change the encoding to UTF-8 (as we always use UTF-8 internally) if ($utf8_data = SimplePie_Misc::change_encoding($data, $encoding, 'UTF-8')) { // Create new parser $parser =& new $this->parser_class(); // If it's parsed fine if ($parser->parse($utf8_data, 'UTF-8')) { $this->data = $parser->get_data(); if ($this->get_type() & ~SIMPLEPIE_TYPE_NONE) { if (isset($headers)) { $this->data['headers'] = $headers; } $this->data['build'] = SIMPLEPIE_BUILD; // Cache the file if caching is enabled if ($cache && !$cache->save($this)) { trigger_error("$cache->name is not writeable", E_USER_WARNING); } return true; } else { $this->error = "A feed could not be found at $this->feed_url"; SimplePie_Misc::error($this->error, E_USER_NOTICE, __FILE__, __LINE__); return false; } } }

function get_type() { if (!isset($this->data['type'])) { $this->data['type'] = SIMPLEPIE_TYPE_ALL; if (isset($this->data['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['feed'])) { $this->data['type'] &= SIMPL