Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
Florine W. Dekker | d7c2658ba6 |
|
@ -1,7 +1,7 @@
|
|||
;<?php exit(); ?>
|
||||
|
||||
[admin]
|
||||
# PHC-formatted hash of password for the CLI of `api.php`. (You can create one using PHP's `password_hash`.) Escaping
|
||||
# PHC-formatted hash of password for the CLI of `api.php`. You can create one using PHP's `password_hash`. Escaping
|
||||
# dollar symbols is optional. If set to its default value, or if empty, the CLI is disabled.
|
||||
cli_password = "REPLACE THIS WITH A SECRET VALUE"
|
||||
|
||||
|
|
|
@ -46,13 +46,8 @@ class Wikipedia
|
|||
*/
|
||||
private function api_fetch(array $params): mixed
|
||||
{
|
||||
$config = Config::get("wikipedia");
|
||||
$user_agent =
|
||||
sprintf(
|
||||
self::USER_AGENT_FORMAT,
|
||||
$config["user_agent_contact"],
|
||||
"curl/" . curl_version()["version"],
|
||||
);
|
||||
$curl_version = curl_version()["version"] ?? "unknown";
|
||||
$user_agent = sprintf(self::USER_AGENT_FORMAT, Config::get("wikipedia")["user_agent_contact"], $curl_version);
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
|
|
Loading…
Reference in New Issue