Resolve error in default ini

This commit is contained in:
Florine W. Dekker 2023-09-04 15:04:08 +02:00
parent 2daa74b319
commit d7c2658ba6
Signed by: FWDekker
GPG Key ID: D3DCFAA8A4560BE0
2 changed files with 3 additions and 8 deletions

View File

@ -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"

View File

@ -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);