viewgit/inc/functions.php:22 Function utf8_encode() is deprecated [8192]

Fix notices in Website.php, tweak slidy and wiki link behavior, a=chris

Chris Pollett [2020-06-26 20:Jun:th]
Fix notices in Website.php, tweak slidy and wiki link behavior, a=chris
Filename
src/library/WebSite.php
src/scripts/slidy.js
src/views/elements/GroupbarElement.php
diff --git a/src/library/WebSite.php b/src/library/WebSite.php
index a020d2d59..8d59ab521 100644
--- a/src/library/WebSite.php
+++ b/src/library/WebSite.php
@@ -1323,7 +1323,11 @@ class WebSite
             $key = (int)$out_stream;
             $data = $this->out_streams[self::DATA][$key];
             $num_bytes = fwrite($out_stream, $data);
-            $remaining_bytes = max(0, strlen($data) - $num_bytes);
+            if ($num_bytes === false) {
+                $remaining_bytes = 0;
+            } else {
+                $remaining_bytes = max(0, strlen($data) - $num_bytes);
+            }
             if ($num_bytes > 0) {
                 $this->out_streams[self::DATA][$key] =
                     substr($data, $num_bytes);
@@ -1594,6 +1598,10 @@ class WebSite
             if (in_array($key, $this->immortal_stream_keys)) {
                 continue;
             }
+            if (empty($this->in_streams[self::CONNECTION][$key])) {
+                $this->shutdownHttpStream($key);
+                continue;
+            }
             $meta = stream_get_meta_data(
                 $this->in_streams[self::CONNECTION][$key]);
             $in_time = empty($this->in_streams[self::MODIFIED_TIME][$key]) ?
diff --git a/src/scripts/slidy.js b/src/scripts/slidy.js
index 253f4c62e..1dd536b34 100644
--- a/src/scripts/slidy.js
+++ b/src/scripts/slidy.js
@@ -86,12 +86,10 @@ var w3c_slidy = {
         window.resizeBy(0, 1);
     },
     init: function () {
-     //   if (slide_elt = document.getElementById("slide-show")) {
-       //     this.body = slide_elt;
-        //} else {
-            this.body = document.body;
-       // }
-        setDisplay("top-container", false);
+        this.body = document.body;
+        if (typeof setDisplay === "function") {
+            setDisplay("top-container", false);
+        }
         this.body.style.visibility = "visible";
         this.init_localization();
         this.add_toolbar();
diff --git a/src/views/elements/GroupbarElement.php b/src/views/elements/GroupbarElement.php
index 33761811c..a908c92be 100644
--- a/src/views/elements/GroupbarElement.php
+++ b/src/views/elements/GroupbarElement.php
@@ -102,7 +102,8 @@ class GroupbarElement extends Element
                     $data['PAGE_NAME'], true, $data['CONTROLLER'],
                     $data["GROUP"]["GROUP_ID"])) . $token_string;
                 ?>
-                <a href='<?=$wiki_base_url ?>' ><?=$page_name; ?></a>
+                <a href='<?=$wiki_base_url
+                    ?>'  target='preview'><?=$page_name; ?></a>
                 <?php
             }
         } else if (isset($data['JUST_THREAD'])) {
ViewGit