File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -132,14 +132,20 @@ protected function extractCodeFromCreationResponse(ResponseInterface $response)
132132 {
133133 $ headers = $ response ->getHeaders ();
134134
135- $ location = isset ($ headers ['Location ' ][0 ]) ? $ headers ['Location ' ][0 ] : $ headers ['location ' ][0 ] ?? null ;
135+ if (isset ($ headers ['Location ' ][0 ])) {
136+ $ locationHeader = $ headers ['Location ' ][0 ];
137+ }
138+
139+ if (isset ($ headers ['location ' ][0 ])) {
140+ $ locationHeader = $ headers ['location ' ][0 ];
141+ }
136142
137- if (is_null ( $ location )) {
143+ if (! isset ( $ locationHeader )) {
138144 throw new RuntimeException ('The response does not contain the URI of the created media-file. ' );
139145 }
140146
141147 $ matches = [];
142- if (1 !== preg_match (static ::MEDIA_FILE_URI_CODE_REGEX , $ location , $ matches )) {
148+ if (1 !== preg_match (static ::MEDIA_FILE_URI_CODE_REGEX , $ locationHeader , $ matches )) {
143149 throw new RuntimeException ('Unable to find the code in the URI of the created media-file. ' );
144150 }
145151
You can’t perform that action at this time.
0 commit comments