!str_starts_with(basename($path), 'admin') )); foreach (['auth.js', 'user-home.js', 'ticket-page.js', 'recharge.js', 'fuck.js'] as $script) { $files[] = $public . '/theme/venix/js/' . $script; } foreach (['auth', 'cloud', 'home', 'password', 'user'] as $viewDirectory) { $directory = $views . '/' . $viewDirectory; if (!is_dir($directory)) { continue; } $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($directory, FilesystemIterator::SKIP_DOTS) ); foreach ($iterator as $file) { if ($file->isFile() && $file->getExtension() === 'tpl') { $files[] = $file->getPathname(); } } } $violations = []; $patterns = [ '/\b(?:window|globalThis|self|top|parent)\s*\.\s*(?:alert|confirm|prompt)\s*\(/', '/(? $call) { $details[] = str_replace($root . '/', '', $location) . ' (' . $call . ')'; } throw new RuntimeException( "Ordinary user pages still invoke browser-native dialogs:\n- " . implode("\n- ", $details) ); } $topbar = file_get_contents($views . '/user/panel_topbar.tpl'); $markup = file_get_contents($views . '/user/dialog.tpl'); $runtime = file_get_contents($public . '/cloud/user-dialog.js'); $styles = file_get_contents($public . '/cloud/client.css'); $assets = file_get_contents($views . '/layout_assets.tpl'); $entry = file_get_contents($public . '/cloud/app.js'); foreach (compact('topbar', 'markup', 'runtime', 'styles', 'assets', 'entry') as $name => $source) { $assert(is_string($source), 'Unable to read user dialog asset: ' . $name); } $assert(str_contains($topbar, "{include file='user/dialog.tpl'}") && str_contains($topbar, 'src="/cloud/user-dialog.js?v={$venix_asset_version'), 'The shared user shell must mount the in-product dialog with the common cache key.'); $assert(str_contains($markup, 'id="panel-user-dialog"') && str_contains($markup, 'aria-labelledby="panel-user-dialog-title"') && str_contains($markup, 'aria-describedby="panel-user-dialog-message panel-user-dialog-verification-hint"'), 'The shared user dialog must expose an accessible name and description.'); $assert(str_contains($runtime, 'window.VenixDialog = Object.freeze') && str_contains($runtime, 'textContent =') && !str_contains($runtime, 'innerHTML'), 'The dialog API must render dynamic copy as text and expose the shared browser contract.'); $assert(str_contains($styles, '.panel-user-dialog::backdrop') && str_contains($styles, '.panel-user-dialog.is-dialog-fallback') && str_contains($styles, '@media (prefers-reduced-motion: reduce)'), 'The user dialog must retain a styled fallback and reduced-motion behavior.'); $assert(preg_match("/value='([0-9]+)'/", $assets, $assetMatch) === 1 && preg_match('/task-center\\.js\\?v=([0-9]+)/', $entry, $entryMatch) === 1 && $assetMatch[1] === $entryMatch[1], 'The shared asset version and application module cache key must stay synchronized.'); echo "Ordinary user native-dialog boundary checks passed.\n";