Plugin Directory

Changeset 778204


Ignore:
Timestamp:
09/25/2013 08:39:08 AM (13 years ago)
Author:
Driskell
Message:

Update dev version

Location:
wponlinebackup/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wponlinebackup/trunk/include/admin.php

    r778188 r778204  
    16951695        $creation_dates = array();
    16961696
    1697         foreach ( $result as $download ) {
     1697        foreach ( $result as $key => $download ) {
    16981698
    16991699            // Does it actually exist?
     
    17081708                    'WHERE filename = \'' . $esc_filename . '\''
    17091709                );
     1710
     1711                unset( $result[ $key ] );
    17101712
    17111713                continue;
     
    17461748                    'compressed'    => 0, // Maybe we can try detect this from the ENC/ZIP headers...
    17471749                    'encrypted' => $encrypted,
     1750                    'filename'  => $f,
    17481751                );
    17491752
     
    17511754                if ( $f != ( $futf = WPOnlineBackup_Functions::UTF8_Validate( $f ) ) ) {
    17521755
    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 );
    17541757
    17551758                } else {
    1756 
    1757                     $add['filename'] = $f;
    17581759
    17591760                    // Add to database
     
    17671768
    17681769                // Add to results
    1769                 $result[] = $add;
     1770                $result[] = & $add;
     1771                $filenames[ $add['filename'] ] = & $add;
    17701772                $creation_dates[] = $created;
     1773
     1774                unset( $add );
    17711775
    17721776            }
     
    18221826                if ( $download['locked'] )
    18231827                    echo sprintf( __( '%s <b>(LOCKED)</b>', 'wponlinebackup' ), esc_html( $download['filename'] ) );
     1828                else if ( isset( $download['invalid_utf8'] ) )
     1829                    echo $download['invalid_utf8'];
    18241830                else
    18251831                    echo esc_html( $download['filename'] );
  • wponlinebackup/trunk/include/tables.php

    r768959 r778204  
    2929        $this->WPOnlineBackup = & $WPOnlineBackup;
    3030
     31        $this->db_prefix = $wpdb->prefix;
     32
    3133        // 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]+_';
    3535
    3636        // Generate internal table list
  • wponlinebackup/trunk/wponlinebackup.php

    r778188 r778204  
    6363    /*public*/ function Handler( $type, $message, $file, $line, $context )
    6464    {
    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        }
    7182
    7283        // Call the original error handler
     
    264275        // PHP4 does not have error_get_last, so let's create one
    265276        // 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();
    278282
    279283        function OBFW_Exception()
    280284        {
    281             $err = error_get_last();
     285            $err = $GLOBALS['OBFW_Error_Handler']->Get_Last();
    282286            if ( is_null( $err ) )
    283287                return __( 'No message was logged.', 'wponlinebackup' );
     
    292296        function OBFW_Raw_Exception()
    293297        {
    294             $err = error_get_last();
     298            $err = $GLOBALS['OBFW_Error_Handler']->Get_Last();
    295299            if ( is_null( $err ) )
    296300                return __( 'No message was logged.', 'wponlinebackup' );
     
    302306        function OBFW_Tidy_Exception()
    303307        {
    304             $err = error_get_last();
     308            $err = $GLOBALS['OBFW_Error_Handler']->Get_Last();
    305309            if ( is_null( $err ) )
    306310                return __( 'No message was logged.', 'wponlinebackup' );
Note: See TracChangeset for help on using the changeset viewer.