Files
html/api/ambre-v9-ok.php
2026-04-22 04:30:07 +02:00

24 lines
601 B
PHP

<?php
header("Content-Type: application/json");
$path = "/var/www/html/wevia.html";
$c = @file_get_contents($path);
$orig = strlen($c);
$old = "if (data && data.success) {";
$new = "if (data && (data.ok || data.success)) {";
if (strpos($c, $old) === false) {
echo json_encode(["error"=>"V9 success check not found"]);
exit;
}
$c = str_replace($old, $new, $c);
$backup = "/opt/wevads/vault/wevia.html.GOLD-" . date("Ymd-His") . "-wave247-v9-ok";
@copy($path, $backup);
$wrote = @file_put_contents($path, $c);
echo json_encode([
"delta" => strlen($c) - $orig,
"wrote" => $wrote,
]);