Compare commits

...

3 Commits

Author SHA1 Message Date
Lazarus b7b3a1781a Fix some CSS and security issues 2024-01-07 15:26:27 +01:00
Christophe HENRY 442232a990 Adds Lazarus/omarpolo to the style sample 2023-08-01 22:29:46 +02:00
Christophe HENRY 5af1cae80a v1.5.1+ 2023-08-01 22:25:14 +02:00
4 changed files with 18 additions and 10 deletions

View File

@ -4,6 +4,7 @@
=> index.gmi|default,base.css default/base.css
=> index.gmi|default,circumlunar.css default/circumlunar.css
=> index.gmi|lagrange,lagrange.css lagrange/lagrange.css
=> index.gmi|lazarus,omarpolo.css lazarus/omarpolo.css
=> index.gmi|default,terminal.css default/terminal.css
=> index.gmi|default,black_wide.css default/black_wide.css
=> index.gmi|default,simple.css default/simple.css

View File

@ -2,6 +2,7 @@
/* style from Omar Polo: https://gmid.omarpolo.com/style.css */
body {
background-color: white;
font-family: monospace;
font-size: 14px;
max-width: 780px;
@ -15,7 +16,7 @@ h1::before {
}
h2 {
margin-top: 40px;
margin-top: 20px;
}
h2::before {
@ -48,6 +49,10 @@ p.link::before {
content: "→ ";
}
p {
margin: 0;
}
strong::before { content: "*" }
strong::after { content: "*" }
@ -120,4 +125,4 @@ color: #ff4cff;
@media (max-width: 500px) {
pre.banner { font-size: 10px; }
}
}

View File

@ -1,6 +1,6 @@
```
__ __ __ ______
|\ \ |\ \ |\ \ /\ \ v1.5.0+
|\ \ |\ \ |\ \ /\ \ v1.5.1+
| ▓▓ | ▓▓_| ▓▓_ ______ ____ | ▓▓▓▓▓▓\
| ▓▓__| ▓▓ ▓▓ \ |\ \ \| ▓▓ __\▓▓/\ \| \ \
| ▓▓ ▓▓\▓▓▓▓▓▓ | ▓▓▓▓▓▓\▓▓▓▓\ ▓▓| \ ▓▓▓▓▓▓\ ▓▓▓▓▓▓\▓▓▓▓\

View File

@ -12,6 +12,12 @@ $domain = $_SERVER['HTTP_HOST'];
$php_self = $_SERVER['PHP_SELF']; // by default: /htmgem/index.php
$php_self_dir = dirname($php_self);
$url = @$_REQUEST["url"];
if(isset($_REQUEST['style']))
$style = htmlspecialchars($_REQUEST['style']);
else
$style = "";
$urlRewriting = @$_REQUEST["rw"]=="1";
/**
@ -66,7 +72,7 @@ if ($go404) {
http_response_code(404);
$page404 = \htmgem\html\get404GmiPage($url);
$gt_html = new \htmgem\GemTextTranslate_html($page404);
if (empty($gt_html->getCss())) $gt_html->addCss($php_self_dir."/css/htmgem.css");
if (empty($gt_html->getCss())) $gt_html->addCss($php_self_dir.DEFAULT_CSS);
if ($urlRewriting)
echo \htmgem\html\getHtmlWithMenu($gt_html, $scheme, $domain, $url);
else
@ -82,8 +88,6 @@ $fileContents = @file_get_contents($filePath);
/* CSS and special style management
*/
$style = @$_REQUEST['style'];
if ("source" == $style) {
$basename = basename($filePath);
header("Cache-Control: public");
@ -123,12 +127,10 @@ if (empty($style)) {
} else {
$style = preg_replace("/,/", "/", $style);
if ("/" == $php_self_dir) $php_self_dir = ""; # dirname() never use a final slash except for the root
$gt_html->addCss("$php_self_dir/css/$style");
$gt_html->addCss($php_self_dir."/css/$style");
}
if ($urlRewriting)
echo \htmgem\html\getHtmlWithMenu($gt_html, $scheme, $domain, $url);
else
echo \htmgem\html\getHtmlWithMenu($gt_html, $scheme, $domain, $url, "$php_self?url=");
?>
echo \htmgem\html\getHtmlWithMenu($gt_html, $scheme, $domain, $url, "$php_self?url=");