Changeset 778204
- Timestamp:
- 09/25/2013 08:39:08 AM (13 years ago)
- Location:
- wponlinebackup/trunk
- Files:
-
- 3 edited
-
include/admin.php (modified) (6 diffs)
-
include/tables.php (modified) (1 diff)
-
wponlinebackup.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wponlinebackup/trunk/include/admin.php
r778188 r778204 1695 1695 $creation_dates = array(); 1696 1696 1697 foreach ( $result as $ download ) {1697 foreach ( $result as $key => $download ) { 1698 1698 1699 1699 // Does it actually exist? … … 1708 1708 'WHERE filename = \'' . $esc_filename . '\'' 1709 1709 ); 1710 1711 unset( $result[ $key ] ); 1710 1712 1711 1713 continue; … … 1746 1748 'compressed' => 0, // Maybe we can try detect this from the ENC/ZIP headers... 1747 1749 'encrypted' => $encrypted, 1750 'filename' => $f, 1748 1751 ); 1749 1752 … … 1751 1754 if ( $f != ( $futf = WPOnlineBackup_Functions::UTF8_Validate( $f ) ) ) { 1752 1755 1753 $add[' filename'] = sprintf( __( '%s <b>(Contains invalid characters, please rename via FTP)</b>', 'wponlinebackup' ), $futf );1756 $add['invalid_utf8'] = sprintf( __( '%s <b>(Contains invalid characters, please rename via FTP)</b>', 'wponlinebackup' ), $futf ); 1754 1757 1755 1758 } else { 1756 1757 $add['filename'] = $f;1758 1759 1759 1760 // Add to database … … 1767 1768 1768 1769 // Add to results 1769 $result[] = $add; 1770 $result[] = & $add; 1771 $filenames[ $add['filename'] ] = & $add; 1770 1772 $creation_dates[] = $created; 1773 1774 unset( $add ); 1771 1775 1772 1776 } … … 1822 1826 if ( $download['locked'] ) 1823 1827 echo sprintf( __( '%s <b>(LOCKED)</b>', 'wponlinebackup' ), esc_html( $download['filename'] ) ); 1828 else if ( isset( $download['invalid_utf8'] ) ) 1829 echo $download['invalid_utf8']; 1824 1830 else 1825 1831 echo esc_html( $download['filename'] ); -
wponlinebackup/trunk/include/tables.php
r768959 r778204 29 29 $this->WPOnlineBackup = & $WPOnlineBackup; 30 30 31 $this->db_prefix = $wpdb->prefix; 32 31 33 // Cache multisite regex stuff - the regex must end in # since we use that in the code that references it 32 $this->multisite_prefix_regex = '#^(' . preg_quote( $db_prefix, '#' ) . ')[0-9]+_'; 33 34 $this->db_prefix = $wpdb->prefix; 34 $this->multisite_prefix_regex = '#^(' . preg_quote( $this->db_prefix, '#' ) . ')[0-9]+_'; 35 35 36 36 // Generate internal table list -
wponlinebackup/trunk/wponlinebackup.php
r778188 r778204 63 63 /*public*/ function Handler( $type, $message, $file, $line, $context ) 64 64 { 65 $this->Last = array( 66 'type' => $type, 67 'message' => $message, 68 'file' => $file, 69 'line' => $line, 70 ); 65 // Filter known WordPress related errors due to us running INSERT and such within query() 66 $skip = false; 67 if ( $type == E_WARNING ) { 68 if ( substr( $file, -10 ) == '/wp-db.php' && substr( $message, 0, 76 ) == 'mysql_fetch_object(): supplied argument is not a valid MySQL result resource' ) 69 $skip = true; 70 } 71 72 if ( !$skip ) { 73 74 $this->Last = array( 75 'type' => $type, 76 'message' => $message, 77 'file' => $file, 78 'line' => $line, 79 ); 80 81 } 71 82 72 83 // Call the original error handler … … 264 275 // PHP4 does not have error_get_last, so let's create one 265 276 // We could use php_errormsg but it requires track_errors On and we need to pass it as a parameter to OBFW_Exception, and it won't exist if there is a user error handler that returned true 266 if ( !function_exists( 'error_get_last' ) ) { 267 268 // We use GLOBALS since it's easier than global keyword 269 $GLOBALS['OBFW_Error_Handler'] = new OBFW_Error_Handler(); 270 $GLOBALS['OBFW_Error_Handler']->Init(); 271 272 function error_get_last() 273 { 274 return $GLOBALS['OBFW_Error_Handler']->Get_Last(); 275 } 276 277 } 277 // We can use this handler for PHP5 too as it will filter known warnings that we are not interested in 278 279 // We use GLOBALS since it's easier than global keyword 280 $GLOBALS['OBFW_Error_Handler'] = new OBFW_Error_Handler(); 281 $GLOBALS['OBFW_Error_Handler']->Init(); 278 282 279 283 function OBFW_Exception() 280 284 { 281 $err = error_get_last();285 $err = $GLOBALS['OBFW_Error_Handler']->Get_Last(); 282 286 if ( is_null( $err ) ) 283 287 return __( 'No message was logged.', 'wponlinebackup' ); … … 292 296 function OBFW_Raw_Exception() 293 297 { 294 $err = error_get_last();298 $err = $GLOBALS['OBFW_Error_Handler']->Get_Last(); 295 299 if ( is_null( $err ) ) 296 300 return __( 'No message was logged.', 'wponlinebackup' ); … … 302 306 function OBFW_Tidy_Exception() 303 307 { 304 $err = error_get_last();308 $err = $GLOBALS['OBFW_Error_Handler']->Get_Last(); 305 309 if ( is_null( $err ) ) 306 310 return __( 'No message was logged.', 'wponlinebackup' );
Note: See TracChangeset
for help on using the changeset viewer.