From 7375af9eb586bc19130937dd43d8c4412faa9738 Mon Sep 17 00:00:00 2001 From: Miglen Evlogiev <--help> Date: Wed, 27 May 2026 23:56:42 +0300 Subject: [PATCH 1/2] Modernise the interface (HTML5 + dark-mode-aware stylesheet) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refreshes the look without changing any flows, form fields, or class names. Same forms, same options menu, same buttons — just modern. - files/css/index.css rewritten as the single source of truth: CSS custom properties for palette, system font stack, automatic prefers-color-scheme dark mode, mobile-first responsive, subtle shadows, accessible focus rings (3px accent halo on inputs), accent-color on checkboxes - files/php/index.inc.php switched from XHTML 1.0 Transitional to HTML5; inline - - - - - -
-
-
-

-
-
- -
-
- - -
+ + + + + + <?php echo htmlspecialchars($GLOBALS['_config']['site_name']); ?> + + + + + + +
+
+

+
+
+ +
+
+ + +
-
- - -
-
-

Options

-
-
- +
+ + +
+
+

Options

+
+
    + $flag_value) { if (!$GLOBALS['_frozen_flags'][$flag_name]) { - echo '
  • ' . "\n"; + echo '
  • ' . "\n"; } } ?> -
- MORE... -
- + + More settings → +
+
- - -
-
-
-

Authentication Required

-
- -
- - -
- -
- - Cancel -
- -

Authentication Required: The supplied credentials were unauthorized to access the specified content.

- -

Authentication Required: Enter your username and password for "" on

- -
+ + +
+
+

Authentication Required

+
+ +
+ +
+
+ +
+
+ + Cancel +
+ +

Authentication Required: The supplied credentials were unauthorized to access the specified content.

+ +

Authentication Required: Enter your username and password for "" on

+ +
- -
PHProxy
- + + + diff --git a/index.php b/index.php index ea07f5e..968ab23 100644 --- a/index.php +++ b/index.php @@ -1096,22 +1096,31 @@ function _stripslashes(mixed $value): mixed require_once "./files/php/misc.override.php"; if ($_flags['include_form'] && !isset($_GET['nf'])) { - $_url_form = '
' - . '
' - . ' ' - . ' ' - . ' [go: up one dir, main page]' - . '

'; - + // PHProxy mini URL bar injected into proxied pages. + // Uses scoped inline styles so it survives the target page's CSS. + $_bar_style = "all:initial;display:block;position:relative;z-index:2147483647;box-sizing:border-box;width:100%;margin:0;padding:8px 12px;background:#0f172a;color:#f1f5f9;font:13px/1.4 -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;border-bottom:1px solid #334155;"; + $_bar_input = 'box-sizing:border-box;flex:1 1 320px;min-width:0;padding:6px 10px;background:#1e293b;color:#f1f5f9;border:1px solid #334155;border-radius:6px;font:inherit;'; + $_bar_btn = 'padding:6px 14px;background:#3b82f6;color:#fff;border:0;border-radius:6px;font:600 13px inherit;cursor:pointer;text-decoration:none;'; + $_bar_link = 'color:#93c5fd;text-decoration:none;margin-left:8px;'; + $_bar_chk = 'color:#cbd5e1;font:13px inherit;display:inline-flex;align-items:center;gap:4px;margin-right:12px;'; + + $_url_form = '
' + . '' + . '' + . '' + . 'Up' + . 'Home' + . ''; + + $_url_form .= '
'; foreach ($_flags as $flag_name => $flag_value) { if (!$_frozen_flags[$flag_name]) { - $_url_form .= ' '; + $_url_form .= ''; } } - - $_url_form .= '
'; + $_url_form .= '
'; $_response_body = preg_replace('#\<\s*body(.*?)\>#si', "$0\n$_url_form" , $_response_body, 1); } } From fc0b415d333f4744ff2a9fd29a2ef482a4cea6fc Mon Sep 17 00:00:00 2001 From: Miglen Evlogiev <--help> Date: Thu, 28 May 2026 00:03:16 +0300 Subject: [PATCH 2/2] Tabbed Options/Cookies/Headers + theme toggle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Layout now mirrors a single-card-per-section model with a top app bar: PHProxy. [sun/moon SVG] ┌─────────────────────────────────────────────┐ │ [https://www.example.com/ ] [Proxify ] │ └─────────────────────────────────────────────┘ ┌─────────────────────────────────────────────┐ │ Options Cookies Headers │ │ ───────── │ │ ☐ Include Form ☐ Remove Scripts ... │ └─────────────────────────────────────────────┘ - CSS-only tabs (radio inputs + sibling selectors, no JS dependency). Options is the default tab. - Cookies tab enumerates non-settings $_COOKIE entries the proxy is holding for proxied sites, with a "Clear all cookies" action that POSTs ?action=clear-cookies. The handler in index.php sends an expired Set-Cookie for each (under both / and .HTTP_HOST domains) and redirects back. Settings cookies (flags, userAgent, PHPSESSID) are preserved. - Headers tab moves the User-Agent picker inline (with a tighter, modern UA list). The Save button submits via formaction="edit.php" formnovalidate so the existing edit.php handler keeps working — edit.php is unchanged for backward compatibility. - Theme toggle: 36x36 ghost button in the app bar with two inline SVGs (sun/moon, currentColor stroke). Click flips a data-theme attribute on between light/dark and persists in localStorage. An early inline + +
+
+

.

+ +
+ -
-
-
-

-
-
- -
-
- - -
+ +
+
+ + +
'; + echo '

'; switch ($data['group']) { case 'url': @@ -59,74 +83,141 @@ echo 'Resource Error: '; switch ($data['type']) { case 'file_size': - $message = 'The file your are attempting to download is too large.
' - . 'Maxiumum permissible file size is ' . number_format($GLOBALS['_config']['max_file_size'] / 1048576, 2) . ' MB
' + $message = 'The file your are attempting to download is too large.
' + . 'Maxiumum permissible file size is ' . number_format($GLOBALS['_config']['max_file_size'] / 1048576, 2) . ' MB
' . 'Requested file size is ' . number_format($GLOBALS['_content_length'] / 1048576, 2) . ' MB'; break; case 'hotlinking': - $message = 'It appears that you are trying to access a resource through this proxy from a remote Website.
' + $message = 'It appears that you are trying to access a resource through this proxy from a remote Website.
' . 'For security reasons, please use the form below to do so.'; break; } break; } - echo 'An error has occured while trying to browse through the proxy.
' . $message . '

'; + echo 'An error has occured while trying to browse through the proxy.
' . $message . '

'; break; } ?> -
- - -
-
-

Options

-
    - + + +
    +
    + + + + + + +
    +
      $flag_value) { if (!$GLOBALS['_frozen_flags'][$flag_name]) { - echo '
    • ' . "\n"; + echo '
    • ' . "\n"; } } ?> -
    - More settings → -
    - - - -
    -
    -
    -

    Authentication Required

    -
    - -
    - -
    -
    - -
    -
    - - Cancel +
+ + +
+ +

No proxied cookies stored.

+ + +

cookie held for proxied sites.

+ + +
+ +
+
+ +
+

Outgoing request headers sent on your behalf. Empty means "use browser default", . means "use my real browser User-Agent", - means "send no User-Agent".

+
+ +
+
+ +
+
+
- -

Authentication Required: The supplied credentials were unauthorized to access the specified content.

- -

Authentication Required: Enter your username and password for "" on

-
- + + +
+
+
+

Authentication Required

+
+ +
+ +
+
+ +
+
+ + Cancel +
+ +

Authentication Required: The supplied credentials were unauthorized to access the specified content.

+ +

Authentication Required: Enter your username and password for "" on

+ +
+
- + + + + + diff --git a/index.php b/index.php index 968ab23..69fef8d 100644 --- a/index.php +++ b/index.php @@ -152,6 +152,24 @@ // Functions declaration require_once "./files/php/functions.inc.php"; +// +// CLEAR COOKIES action (from the Cookies tab) +// Expires every non-settings cookie under the proxy's own domain and bounces +// back to the entry form. +// +if (isset($_GET['action']) && $_GET['action'] === 'clear-cookies' && $_SERVER['REQUEST_METHOD'] === 'POST') +{ + $_settings = ['flags', 'userAgent', 'PHPSESSID']; + foreach ($_COOKIE as $_ck_name => $_ck_value) + { + if (in_array($_ck_name, $_settings, true)) continue; + setcookie($_ck_name, '', time() - 3600, '/'); + setcookie($_ck_name, '', time() - 3600, '/', '.' . $_http_host); + } + header('Location: ' . $_script_url); + exit(0); +} + // // SET FLAGS //