WordPress.org

Make WordPress Core

Changeset 23374


Ignore:
Timestamp:
02/02/2013 02:01:59 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Return WP_Error from wp_crop_image() if saving has failed. props macbrink. fixes #23325.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/image.php

    r22817 r23374  
    2121 * @param int $src_abs Optional. If the source crop points are absolute.
    2222 * @param string $dst_file Optional. The destination file to write to.
    23  * @return string|WP_Error|false New filepath on success, WP_Error or false on failure.
     23 * @return string|WP_Error New filepath on success, WP_Error on failure.
    2424 */
    2525function wp_crop_image( $src, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs = false, $dst_file = false ) {
     
    5555
    5656    $result = $editor->save( $dst_file );
     57    if ( is_wp_error( $result ) )
     58        return $result;
     59
    5760    return $dst_file;
    5861}
Note: See TracChangeset for help on using the changeset viewer.