Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
Florine W. Dekker | d7c2658ba6 |
|
@ -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"
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue