Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lotw fixing #3101

Merged
merged 3 commits into from
May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions application/controllers/Lotw.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,23 +297,13 @@ public function lotw_upload() {
//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.
$filePath = curl_file_create($filePath);
} else{
//Otherwise, do it the old way.
//Get the canonicalized pathname of our file and prepend
//the @ character.
$filePath = '@' . realpath($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(
$uploadFieldName => $filePath
$uploadFieldName => $uploadfile
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
Expand Down Expand Up @@ -967,7 +957,7 @@ function signlog($sign_key, $string) {
openssl_free_key($pkeyid);
}
$signature_b64 = base64_encode($signature);
return $signature_b64;
return $signature_b64."\n";
}


Expand Down
Loading