From f3c8f0248ec675613c8ad80057fcc10e868a11cd Mon Sep 17 00:00:00 2001 From: lolicon Date: Sat, 19 Sep 2015 09:50:50 -0500 Subject: [PATCH 1/3] fixed stream spit | tested on home-server, works fine. --- b.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/b.php b/b.php index 1bd3e670..f170de0c 100755 --- a/b.php +++ b/b.php @@ -4,17 +4,18 @@ $dir = "banners/"; $files = scandir($dir); $images = array_diff($files, array('.', '..')); $name = $images[array_rand($images)]; -// open the file in a binary mode -$fp = fopen($dir . $name, 'rb'); + +// snags the extension +$img_extension = pathinfo($name, PATHINFO_EXTENSION); // send the right headers header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1 header('Pragma: no-cache'); // HTTP 1.0 header('Expires: 0'); // Proxies -header('Content-Type: ' . $fp['type']); -header('Content-Length: ' . $fp['bytes']); +header("Content-type: " . $img_extension); +header("Content-Disposition: inline; filename=" . $name); -// dump the picture and stop the script -fpassthru($fp); +// readfile displays the image, passthru seems to spits stream. +readfile($dir.$name); exit; ?> From e53ac3503e7348e178adcf8addd81994846dbbff Mon Sep 17 00:00:00 2001 From: lolicon Date: Sat, 19 Sep 2015 12:27:29 -0500 Subject: [PATCH 2/3] adding "word-break: break-word;" line 323 fixes text breaking out of its division. --- stylesheets/style.css | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/stylesheets/style.css b/stylesheets/style.css index 8750ed3b..ea8b17b9 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -1,7 +1,7 @@ /* backup version before modifying bar.top */ /*for trollin -audio { +audio { display:none; } */ @@ -80,7 +80,7 @@ input[name="post"] { [name="post"] [type="text"][name="subject"] { width: calc(100% - 74px); min-width: 162px; - + } input#upload_file { width: 180px; @@ -89,7 +89,7 @@ input#upload_file { [name="post"] [type="text"]:not([name="subject"]), [name="post"] textarea { width: 236px; min-width: 236px; - } + } input#upload_file { width: 160px; } @@ -191,7 +191,7 @@ header div.subtitle { top: -120px; left: -30px; pointer-events: none; - + } [data-board] > .files > :nth-child(1).multifile > a:before { content: url('/static/partyhat.gif'); @@ -319,7 +319,8 @@ div.delete [type="submit"] { div.postcontainer { display: inline-block; - white-space: nowrap; + white-space: nowrap; /* changed "nowrap" to */ + word-break: break-word; /* bugfix: letters no longer shoot around the screen */ max-width: 100%!important; } div.post.reply p { @@ -347,10 +348,10 @@ div.post.reply div.body a { white-space: pre-wrap; } div.post div.body { - white-space: pre-wrap; /* css-3 */ + white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ word-wrap: normal; margin-left: 19px; } @@ -459,7 +460,7 @@ fieldset label { display: table; position: fixed; width: 100%; - left: 0px; + left: 0px; z-index: 3; background-color: #D6DAF0; border-color: #B7C5D9; @@ -469,7 +470,7 @@ fieldset label { vertical-align: middle; } .bar.top { - text-align: center; + text-align: center; top: 0px; border-bottom: 1px solid #B7C5D9; } @@ -504,7 +505,7 @@ div.pages.top { z-index: 99; font-size: 10pt; text-align: left; - + } div.pages a.selected { @@ -521,7 +522,7 @@ div.pages form { } div.pages form input { margin: 0 5px; - + margin-top: -1px; display: inline; } @@ -536,7 +537,7 @@ div.boardlist { #style-select { display: table-cell; font-size: 10pt; - z-index: 3; + z-index: 3; text-align: right; width: auto; } From 9679f970cbfcd839f61466533788eb6afe033ca1 Mon Sep 17 00:00:00 2001 From: Kashire Date: Tue, 22 Sep 2015 19:25:17 -0500 Subject: [PATCH 3/3] Update b.php added path barrucadu's suggestion, not sure why I didn't see it for like 3 days. --- b.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b.php b/b.php index f170de0c..9efa8afa 100755 --- a/b.php +++ b/b.php @@ -12,7 +12,7 @@ $img_extension = pathinfo($name, PATHINFO_EXTENSION); header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1 header('Pragma: no-cache'); // HTTP 1.0 header('Expires: 0'); // Proxies -header("Content-type: " . $img_extension); +header("Content-type: image/" . $img_extension); header("Content-Disposition: inline; filename=" . $name); // readfile displays the image, passthru seems to spits stream.