Changeset 339017
- Timestamp:
- 01/31/2011 02:28:28 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-db-backup/tags/2.2.4/wp-db-backup.php
r338704 r339017 182 182 break; 183 183 default: 184 $ this->deliver_backup($this->backup_file, $via);184 $this->deliver_backup($this->backup_file, $via); 185 185 echo $this->error_display( 'frame', false ); 186 187 188 189 190 191 192 193 186 194 } 187 195 exit; … … 245 253 <script type="text/javascript"> 246 254 //<![CDATA[ 247 var wpDBBackupWaiting;248 function markSuccess() {249 if ( wpDBBackupWaiting ) {250 try {251 clearTimeout( wpDBBackupWaiting );252 } catch ( err ) {}253 }254 }255 256 255 window.onbeforeunload = function() { 257 256 return "' . __('Navigating away from this page will cause your backup to fail.', 'wp-db-backup') . '"; … … 292 291 case 'http': 293 292 echo ' 294 setProgress("' . __(' Backup Complete!','wp-db-backup') . '");293 setProgress("' . __('','wp-db-backup') . '"); 295 294 window.onbeforeunload = null; 296 295 fram.src = "' . $download_uri . '"; 297 setInterval( function() { 298 fram.src = "' . $download_uri . '&download-retry=1"; 296 297 setTimeout( function() { 298 var secondFrame = document.createElement("iframe"); 299 fram.parentNode.insertBefore(secondFrame, fram); 300 secondFrame.src = "' . $download_uri . '&download-retry=1"; 299 301 }, 30000 ); 300 302 '; … … 1047 1049 1048 1050 if ( file_exists( $gz_diskfile ) ) { 1049 unlink($diskfile); 1051 if ( file_exists( $diskfile ) ) { 1052 unlink($diskfile); 1053 } 1050 1054 $diskfile = $gz_diskfile; 1051 1055 $filename = "{$filename}.gz"; … … 1074 1078 * 1075 1079 */ 1080 1081 1082 1076 1083 } 1077 1084 1078 1085 if ('http' == $delivery) { 1079 if ( ! file_exists($diskfile) && empty( $_GET['download-retry'] ) ) { 1080 $this->error(array('kind' => 'fatal', 'msg' => sprintf(__('File not found:%s','wp-db-backup'), " <strong>$filename</strong><br />") . '<br /><a href="' . $this->page_url . '">' . __('Return to Backup','wp-db-backup') . '</a>')); 1086 if ( ! file_exists( $diskfile ) ) { 1087 if ( empty( $_GET['download-retry'] ) ) { 1088 $this->error(array('kind' => 'fatal', 'msg' => sprintf(__('File not found:%s','wp-db-backup'), " <strong>$filename</strong><br />") . '<br /><a href="' . $this->page_url . '">' . __('Return to Backup','wp-db-backup') . '</a>')); 1089 } else { 1090 return true; 1091 } 1081 1092 } elseif ( file_exists( $diskfile ) ) { 1082 1093 header('Content-Description: File Transfer'); … … 1085 1096 header("Content-Disposition: attachment; filename=$filename"); 1086 1097 $success = readfile($diskfile); 1087 unlink($diskfile); 1098 if ( $success ) { 1099 unlink($diskfile); 1100 } 1088 1101 } 1089 1102 } elseif ('smtp' == $delivery) { … … 1109 1122 $this->error(array('kind' => 'fatal', 'loc' => $location, 'msg' => $msg)); 1110 1123 } else { 1111 unlink($diskfile); 1124 if ( file_exists( $diskfile ) ) { 1125 unlink($diskfile); 1126 } 1112 1127 } 1113 1128 }
Note: See TracChangeset
for help on using the changeset viewer.