mirror of
https://github.com/moodle/moodle.git
synced 2025-04-15 13:33:52 +02:00
MDL-71741 portfolio: Reset header information between requests
The reset process also removes the CURLFile option in the HTTP object, which will avoid the serialisation issue on PHP7.4 and upward
This commit is contained in:
parent
5f91063c91
commit
711d309aa3
@ -235,6 +235,9 @@ class flickr_client extends oauth_helper {
|
||||
|
||||
$response = $this->http->post(self::UPLOAD_ROOT, $params);
|
||||
|
||||
// Reset http header and options to prepare for the next request.
|
||||
$this->reset_state();
|
||||
|
||||
if ($response) {
|
||||
$xml = simplexml_load_string($response);
|
||||
|
||||
@ -254,4 +257,14 @@ class flickr_client extends oauth_helper {
|
||||
throw new moodle_exception('flickr_upload_error', 'core_error', '', null, $response);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets curl state.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function reset_state(): void {
|
||||
$this->http->cleanopt();
|
||||
$this->http->resetHeader();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user