Make WordPress Core


Ignore:
Timestamp:
12/12/2016 06:18:30 AM (10 years ago)
Author:
dd32
Message:

PDF Images: Avoid a PHP Warning when attempting to process a file without an extension.

Props chandrapatel for initial patch.
Fixes #39195.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-image-editor-imagick.php

    r39303 r39580  
    147147                try {
    148148                        $this->image = new Imagick();
    149                         $file_parts = pathinfo( $this->file );
     149                        $file_extension = strtolower( pathinfo( $this->file, PATHINFO_EXTENSION ) );
    150150                        $filename = $this->file;
    151151
    152                         if ( 'pdf' == strtolower( $file_parts['extension'] ) ) {
     152                        if ( 'pdf' == $file_extension ) {
    153153                                $filename = $this->pdf_setup();
    154154                        }
Note: See TracChangeset for help on using the changeset viewer.