- CURLOPT_SSL_VERIFYHOST => FALSE,
- CURLOPT_SSL_VERIFYPEER => FALSE,
- CURLOPT_HTTPHEADER => array('Accept-language: en'),
- CURLOPT_USERAGENT => Tweeper::$userAgent,
- ));
- $contents = curl_exec($ch);
- if (FALSE === $contents) {
- trigger_error(curl_error($ch), E_USER_WARNING);
- }
+ CURLOPT_HTTPHEADER => ['Accept-language: en'],
+ CURLOPT_USERAGENT => isset($user_agent) ? $user_agent : Tweeper::$userAgent,
+ ]);
+ $contents = Tweeper::curlExec($ch);