Unverified Commit ccd7b688 authored by Nathaniel's avatar Nathaniel Committed by GitHub
Browse files

Merge pull request #255 from humanmade/fix-missing-function

Fix instances of wp_tempnam not being defined
parents f9f09b1e 81d75a7f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -278,6 +278,9 @@ class S3_Uploads {
	 * @return string
	 */
	public function copy_image_from_s3( $file ) {
		if ( ! function_exists( 'wp_tempnam' ) ) {
			require_once( ABSPATH . 'wp-admin/includes/file.php' );
		}
		$temp_filename = wp_tempnam( $file );
		copy( $file, $temp_filename );
		return $temp_filename;