From 50226d788ba77f2540ddb47041aecd9ccb33bfc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=AB=E3=83=BC=E3=83=91=E3=83=BC=E3=83=98=E3=82=A4?= =?UTF-8?q?=E3=82=BA?= Date: Sun, 1 Jun 2014 19:08:35 +0900 Subject: [PATCH] Fixes to #81 --- lib/SimilarImages.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/SimilarImages.php b/lib/SimilarImages.php index e4e234e..091755f 100755 --- a/lib/SimilarImages.php +++ b/lib/SimilarImages.php @@ -71,7 +71,11 @@ class SimilarImages if ($search_url) { $params['url'] = $search_url; } else { - $params['file'] = '@' . $source_file; + if (function_exists('curl_file_create')) { // PHP v5.5.* fix + $params['file'] = curl_file_create($source_file); + } else { + $params['file'] = '@' . $source_file; + } } foreach ($services_list as $k => $s) @@ -425,4 +429,4 @@ class SimilarImages { return Rails::publicPath() . self::SEARCH_CACHE_DIR; } -} \ No newline at end of file +}