Make WordPress Core


Ignore:
Timestamp:
12/16/2016 05:38:41 AM (8 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.
Merges [39580] to the 4.7 branch.
Fixes #39195.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-includes/class-wp-image-editor-imagick.php

    r39303 r39607  
    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.