Compare commits

...

1 Commits
v1.3.0 ... main

Author SHA1 Message Date
Florine W. Dekker d7c2658ba6
Resolve error in default ini 2023-09-04 15:04:08 +02:00
2 changed files with 3 additions and 8 deletions

View File

@ -1,7 +1,7 @@
;<?php exit(); ?> ;<?php exit(); ?>
[admin] [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. # 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" cli_password = "REPLACE THIS WITH A SECRET VALUE"

View File

@ -46,13 +46,8 @@ class Wikipedia
*/ */
private function api_fetch(array $params): mixed private function api_fetch(array $params): mixed
{ {
$config = Config::get("wikipedia"); $curl_version = curl_version()["version"] ?? "unknown";
$user_agent = $user_agent = sprintf(self::USER_AGENT_FORMAT, Config::get("wikipedia")["user_agent_contact"], $curl_version);
sprintf(
self::USER_AGENT_FORMAT,
$config["user_agent_contact"],
"curl/" . curl_version()["version"],
);
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);