Changeset 549327
- Timestamp:
- 05/26/2012 06:42:03 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
backup/trunk/backup.php
r549264 r549327 2 2 /* 3 3 Plugin Name: Backup 4 Version: 1.1. 54 Version: 1.1.6 5 5 Plugin URI: http://hel.io/wordpress/backup/ 6 6 Description: Backup your WordPress website to Google Drive. … … 384 384 $context = array( 385 385 'http' => array( 386 'ignore_errors' => true, 386 387 'follow_location' => false, 387 388 'method' => 'POST', … … 458 459 $context = array( 459 460 'http' => array( 461 'ignore_errors' => true, 460 462 'follow_location' => false, 461 463 'method' => 'PUT', … … 483 485 } 484 486 elseif ( strpos( $response, '201' ) ) { 485 return new SimpleXMLElement( $result ); 487 $xml = simplexml_load_string( $result ); 488 if ( $xml === false ) { 489 backup_log( 'ERROR', 'Could not create SimpleXMLElement from ' . $result, __FILE__, __LINE__ ); 490 return false; 491 } 492 else 493 return $xml; 486 494 } 487 495 else { … … 536 544 $context = array( 537 545 'http' => array( 546 'ignore_errors' => true, 538 547 'method' => 'GET', 539 548 'header' => join( "\r\n", $header ) … … 548 557 549 558 if ( $result !== false ) { 550 $xml = new SimpleXMLElement( $result ); 551 error_log( $result ); 552 foreach ( $xml->link as $link ) 553 if ( $link['rel'] == 'http://schemas.google.com/g/2005#resumable-create-media' ) 554 return $link['href']; 559 $xml = simplexml_load_string( $result ); 560 if ( $xml === false ) { 561 backup_log( 'ERROR', 'Could not create SimpleXMLElement from ' . $result, __FILE__, __LINE__ ); 562 return false; 563 } 564 else 565 foreach ( $xml->link as $link ) 566 if ( $link['rel'] == 'http://schemas.google.com/g/2005#resumable-create-media' ) 567 return $link['href']; 555 568 } 556 569 return false;
Note: See TracChangeset
for help on using the changeset viewer.