Please update CURL upload code.
-
My server runs on PHP 7.0, and I found that the plugin cannot attach uploaded files uploaded by cURL, or JS method via administration form.
I checked “Use PHP uploader. Need PHP Curl.” in the Additional Settings because default uploader also does not work.
I looked over your code and I have found that when the code attaches an uploaded file, it uses ‘@’ . filename. But this method may not work PHP5.6+ because it requires curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false). Moreover, it is disabled as of PHP7.0+.
Therefore, switch code should be required. like:
if (function_exists('curl_file_create')) { // php 5.5+ $cFile = curl_file_create($file_name_with_full_path); } else { // $cFile = '@' . realpath($file_name_with_full_path); }( https://stackoverflow.com/questions/15200632/how-to-upload-file-using-curl-with-php )
I changed ‘includes/uaf_font_upload_php.php’ line 32 like below and fixed the upload problem. Please update and fix it.
// includes/uaf_font_upload_php.php': 32 // from 'fontfile' => "@".$_FILES['font_file']['tmp_name'], // to 'fontfile' => (function_exists('curl_file_create') ? curl_file_create($_FILES['font_file']['tmp_name']) : "@".$_FILES['font_file']['tmp_name']),
The topic ‘Please update CURL upload code.’ is closed to new replies.