File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -132,12 +132,14 @@ protected function extractCodeFromCreationResponse(ResponseInterface $response)
132132 {
133133 $ headers = $ response ->getHeaders ();
134134
135- if (!isset ($ headers ['Location ' ][0 ])) {
135+ $ location = isset ($ headers ['Location ' ][0 ]) ? $ headers ['Location ' ][0 ] : $ headers ['location ' ][0 ] ?? null ;
136+
137+ if (is_null ($ location )) {
136138 throw new RuntimeException ('The response does not contain the URI of the created media-file. ' );
137139 }
138140
139141 $ matches = [];
140- if (1 !== preg_match (static ::MEDIA_FILE_URI_CODE_REGEX , $ headers [ ' Location ' ][ 0 ] , $ matches )) {
142+ if (1 !== preg_match (static ::MEDIA_FILE_URI_CODE_REGEX , $ location , $ matches )) {
141143 throw new RuntimeException ('Unable to find the code in the URI of the created media-file. ' );
142144 }
143145
You can’t perform that action at this time.
0 commit comments