Plugin Directory

Changeset 3086913


Ignore:
Timestamp:
05/15/2024 08:01:13 AM (23 months ago)
Author:
Ickata
Message:

Fixed issue when editing older (uploaded long time ago) files

Location:
image-editor-by-pixo
Files:
2 edited
8 copied

Legend:

Unmodified
Added
Removed
  • image-editor-by-pixo/tags/2.3.2/pixo.php

    r2891508 r3086913  
    44Plugin URI: https://pixoeditor.com
    55Description: Provides Pixo as a replacement of the default image editor in your WordPress installation, as well as integrates to your website front-end
    6 Version: 2.3.1
     6Version: 2.3.2
    77*/
    88
     
    941941   $overrides = array( 'test_form' => false );
    942942
    943    $wp_upload_dir = wp_upload_dir();
    944    $original_file = $wp_upload_dir[ 'path' ] . '/' . basename( $metadata[ 'file' ] );
     943   $uploads = wp_upload_dir();
     944   if (!($uploads && false === $uploads['error'])) {
     945      return json_decode('{"error":"Error retrieving upload directory"}');
     946   }
     947
     948   $original_file = $uploads[ 'basedir' ] . '/' . $metadata[ 'file' ];
    945949   $original_file_backup = $original_file . '.original.backup';
    946950   copy( $original_file, $original_file_backup );
     
    948952   switch ( $action ) {
    949953   case PIXOEDITOR_ACTION_SAVE_NEW_UPDATE:
    950       $uploads = wp_upload_dir();
    951       if ( ! ( $uploads && false === $uploads['error'] ) ) {
    952          return json_decode( '{"error":"Error creating new file"}' );
    953       }
    954 
    955954      $filename = wp_unique_filename( $uploads['path'], basename( $pixoeditor__filepath ) );
    956955      $new_file = $uploads['path'] . "/$filename";
     
    987986               // Prepare an array of post data for the attachment.
    988987               $attachment = array(
    989                   'guid'           => $wp_upload_dir['url'] . '/' . basename( $filename ),
     988                  'guid'           => $uploads['url'] . '/' . basename( $filename ),
    990989                  'post_mime_type' => $filetype,
    991990                  'post_title'     => preg_replace( '/\.[^.]+$/', '', basename( $filename ) ),
  • image-editor-by-pixo/tags/2.3.2/readme.txt

    r3070133 r3086913  
    55Requires at least: 3.5
    66Tested up to: 6.5
    7 Stable tag: 2.3.1
     7Stable tag: 2.3.2
    88Requires PHP: 5.2
    99License: GPLv2 or later
     
    104104
    105105== Changelog ==
     106= 2.3.2 =
     107* Fixed issue when editing older (uploaded long time ago) files
     108
    106109= 2.3.1 =
    107110* Security fix, preventing possible phishing CSRF attack
  • image-editor-by-pixo/trunk/pixo.php

    r2891508 r3086913  
    44Plugin URI: https://pixoeditor.com
    55Description: Provides Pixo as a replacement of the default image editor in your WordPress installation, as well as integrates to your website front-end
    6 Version: 2.3.1
     6Version: 2.3.2
    77*/
    88
     
    941941   $overrides = array( 'test_form' => false );
    942942
    943    $wp_upload_dir = wp_upload_dir();
    944    $original_file = $wp_upload_dir[ 'path' ] . '/' . basename( $metadata[ 'file' ] );
     943   $uploads = wp_upload_dir();
     944   if (!($uploads && false === $uploads['error'])) {
     945      return json_decode('{"error":"Error retrieving upload directory"}');
     946   }
     947
     948   $original_file = $uploads[ 'basedir' ] . '/' . $metadata[ 'file' ];
    945949   $original_file_backup = $original_file . '.original.backup';
    946950   copy( $original_file, $original_file_backup );
     
    948952   switch ( $action ) {
    949953   case PIXOEDITOR_ACTION_SAVE_NEW_UPDATE:
    950       $uploads = wp_upload_dir();
    951       if ( ! ( $uploads && false === $uploads['error'] ) ) {
    952          return json_decode( '{"error":"Error creating new file"}' );
    953       }
    954 
    955954      $filename = wp_unique_filename( $uploads['path'], basename( $pixoeditor__filepath ) );
    956955      $new_file = $uploads['path'] . "/$filename";
     
    987986               // Prepare an array of post data for the attachment.
    988987               $attachment = array(
    989                   'guid'           => $wp_upload_dir['url'] . '/' . basename( $filename ),
     988                  'guid'           => $uploads['url'] . '/' . basename( $filename ),
    990989                  'post_mime_type' => $filetype,
    991990                  'post_title'     => preg_replace( '/\.[^.]+$/', '', basename( $filename ) ),
  • image-editor-by-pixo/trunk/readme.txt

    r3070133 r3086913  
    55Requires at least: 3.5
    66Tested up to: 6.5
    7 Stable tag: 2.3.1
     7Stable tag: 2.3.2
    88Requires PHP: 5.2
    99License: GPLv2 or later
     
    104104
    105105== Changelog ==
     106= 2.3.2 =
     107* Fixed issue when editing older (uploaded long time ago) files
     108
    106109= 2.3.1 =
    107110* Security fix, preventing possible phishing CSRF attack
Note: See TracChangeset for help on using the changeset viewer.