From e345975e9c1d8ffbde19bc4bae75480186b2cb76 Mon Sep 17 00:00:00 2001 From: phl0 Date: Mon, 13 May 2024 09:20:06 +0200 Subject: [PATCH] Remove deprecated way of creating upload files --- application/controllers/Lotw.php | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 4bed10aee..f8ecab952 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -304,21 +304,9 @@ class Lotw extends CI_Controller { //Tell cURL to return the output as a string. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - //If the function curl_file_create exists - if(function_exists('curl_file_create')){ - //Use the recommended way, creating a CURLFile object. - $uploadfile = curl_file_create($filePath); - $uploadfile->setPostFilename(basename($filePath)); - } else{ - //Otherwise, do it the old way. - //Get the canonicalized pathname of our file and prepend - //the @ character. - $uploadfile = '@' . realpath($filePath).';filename='.basename($filePath); - //Turn off SAFE UPLOAD so that it accepts files - //starting with an @ - curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false); - } - + //Use the recommended way, creating a CURLFile object. + $uploadfile = curl_file_create($filePath); + $uploadfile->setPostFilename(basename($filePath)); //Setup our POST fields $postFields = array(