25 lines
919 B
PHP
25 lines
919 B
PHP
<?php
|
|
header("Content-Type: text/plain");
|
|
$gold = "/opt/wevads/vault/wevia.html.GOLD-20260421-230109-pre-safe-write";
|
|
$current = "/var/www/html/wevia.html";
|
|
|
|
$g_content = @file_get_contents($gold);
|
|
$c_content = @file_get_contents($current);
|
|
|
|
echo "GOLD size: " . strlen($g_content) . "\n";
|
|
echo "Current size: " . strlen($c_content) . "\n\n";
|
|
|
|
// Parse both with node to see which has error
|
|
file_put_contents("/tmp/gold.js", "void function(){" . extract_main_script($g_content) . "}();");
|
|
file_put_contents("/tmp/current.js", "void function(){" . extract_main_script($c_content) . "}();");
|
|
|
|
echo "=== GOLD node --check ===\n";
|
|
echo @shell_exec("node --check /tmp/gold.js 2>&1 | head -10");
|
|
echo "\n=== Current node --check ===\n";
|
|
echo @shell_exec("node --check /tmp/current.js 2>&1 | head -10");
|
|
|
|
function extract_main_script($html) {
|
|
preg_match('/<script>(.*?)<\/script>/s', $html, $m);
|
|
return $m[1] ?? "";
|
|
}
|