mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-07 17:23:04 +02:00
Replaces usage of the Authorization header with X-PIWIGO-API for API key authentication. This improves consistency and may address issues with standard Authorization header handling.
This commit is contained in:
@@ -59,12 +59,12 @@ if (isset($_GET['auth']))
|
||||
// HTTP_AUTHORIZATION api_key
|
||||
if (
|
||||
defined('IN_WS')
|
||||
and isset($_SERVER['HTTP_AUTHORIZATION'])
|
||||
and !empty($_SERVER['HTTP_AUTHORIZATION'])
|
||||
and isset($_SERVER['HTTP_X_PIWIGO_API'])
|
||||
and !empty($_SERVER['HTTP_X_PIWIGO_API'])
|
||||
and isset($_REQUEST['method'])
|
||||
)
|
||||
{
|
||||
$auth_header = pwg_db_real_escape_string($_SERVER['HTTP_AUTHORIZATION']) ?? null;
|
||||
$auth_header = pwg_db_real_escape_string($_SERVER['HTTP_X_PIWIGO_API']) ?? null;
|
||||
|
||||
if ($auth_header)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user