File tree Expand file tree Collapse file tree 3 files changed +12
-26
lines changed Expand file tree Collapse file tree 3 files changed +12
-26
lines changed Original file line number Diff line number Diff line change @@ -494,7 +494,7 @@ public function exec($ch = null)
494
494
$ this ->headerCallbackData ->stopRequest = false ;
495
495
496
496
// Include additional error code information in error message when possible.
497
- if ($ this ->curlError && function_exists ( ' curl_strerror ' ) ) {
497
+ if ($ this ->curlError ) {
498
498
$ this ->curlErrorMessage =
499
499
curl_strerror ($ this ->curlErrorCode ) . (
500
500
empty ($ this ->curlErrorMessage ) ? '' : ': ' . $ this ->curlErrorMessage
@@ -1567,7 +1567,7 @@ public function diagnose($return = false)
1567
1567
*/
1568
1568
public function reset ()
1569
1569
{
1570
- if (function_exists ( ' curl_reset ' ) && ( is_resource ($ this ->curl ) || $ this ->curl instanceof \CurlHandle) ) {
1570
+ if (is_resource ($ this ->curl ) || $ this ->curl instanceof \CurlHandle) {
1571
1571
curl_reset ($ this ->curl );
1572
1572
} else {
1573
1573
$ this ->curl = curl_init ();
Original file line number Diff line number Diff line change @@ -115,20 +115,12 @@ function get_png()
115
115
return $ tmp_filename ;
116
116
}
117
117
118
- if (function_exists ('finfo_open ' )) {
119
- function mime_type ($ file_path )
120
- {
121
- $ finfo = finfo_open (FILEINFO_MIME_TYPE );
122
- $ mime_type = finfo_file ($ finfo , $ file_path );
123
- finfo_close ($ finfo );
124
- return $ mime_type ;
125
- }
126
- } else {
127
- function mime_type ($ file_path )
128
- {
129
- $ mime_type = mime_content_type ($ file_path );
130
- return $ mime_type ;
131
- }
118
+ function mime_type ($ file_path )
119
+ {
120
+ $ finfo = finfo_open (FILEINFO_MIME_TYPE );
121
+ $ mime_type = finfo_file ($ finfo , $ file_path );
122
+ finfo_close ($ finfo );
123
+ return $ mime_type ;
132
124
}
133
125
134
126
function upload_file_to_server ($ upload_file_path ) {
Original file line number Diff line number Diff line change 312
312
echo '} ' . "\n" ;
313
313
exit ;
314
314
} elseif ($ test === 'error_message ' ) {
315
- if (function_exists ('http_response_code ' )) {
316
- http_response_code (401 );
317
- } else {
318
- header ('HTTP/1.1 401 Unauthorized ' );
319
- }
315
+ // 401 Unauthorized.
316
+ http_response_code (401 );
320
317
exit ;
321
318
} elseif ($ test === 'redirect ' ) {
322
319
if (!isset ($ _GET ['redirect ' ])) {
342
339
echo 'Redirected: ' . $ request_method ;
343
340
} else {
344
341
if ($ request_method === 'POST ' ) {
345
- if (function_exists ('http_response_code ' )) {
346
- http_response_code (303 );
347
- } else {
348
- header ('HTTP/1.1 303 See Other ' );
349
- }
342
+ // 303 See Other.
343
+ http_response_code (303 );
350
344
351
345
header ('Location: ?redirect ' );
352
346
} else {
You can’t perform that action at this time.
0 commit comments