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

fix a bug that prevented installing yioop because index mmemmory constant not defined, fix quoting issue with next resources and in marking partially played video items

Chris Pollett [2020-07-16 00:Jul:th]
fix a bug that prevented installing yioop because index mmemmory constant not defined, fix quoting issue with next resources and in marking partially played video items
Filename
src/configs/Config.php
src/executables/CodeTool.php
src/views/elements/WikiElement.php
diff --git a/src/configs/Config.php b/src/configs/Config.php
index 37f7af37b..5ac9b3a32 100755
--- a/src/configs/Config.php
+++ b/src/configs/Config.php
@@ -457,6 +457,7 @@ if (file_exists(WORK_DIRECTORY . PROFILE_FILE_NAME)) {
     nsdefine('CRAWL_DIR', BASE_DIR);
     /** @ignore */
     nsdefine('LOCALE_DIR', FALLBACK_LOCALE_DIR);
+    nsdefine('INDEX_FILE_MEMORY_LIMIT', "250M");
     /** @ignore */
     nsdefine('LOG_DIR', BASE_DIR . "/log");
     nsdefine('NAME_SERVER', "http://localhost/");
diff --git a/src/executables/CodeTool.php b/src/executables/CodeTool.php
index 59c030960..1d1538ed8 100755
--- a/src/executables/CodeTool.php
+++ b/src/executables/CodeTool.php
@@ -58,7 +58,8 @@ $no_instructions = false;
 $model = new Model();
 $db = $model->db;
 $commands = ["copyright", "clean", "longlines", "search", "replace"];
-$change_extensions = ["php", "js", "ini", "css", "thtml", "xml", "h", "cpp"];
+$change_extensions = ["php", "js", "ini", "css", "thtml", "xml", "h", "cpp",
+    "java", "py"];
 $exclude_paths_containing = ["/.", "/extensions/"];
 $num_spaces_tab = 4;
 if (isset($argv[1]) && in_array($argv[1], $commands)) {
diff --git a/src/views/elements/WikiElement.php b/src/views/elements/WikiElement.php
index 28b39e45d..082ab3fb9 100644
--- a/src/views/elements/WikiElement.php
+++ b/src/views/elements/WikiElement.php
@@ -208,7 +208,7 @@ class WikiElement extends Element implements CrawlConstants
                             $prev_type != $resource['media_type'])) {
                             break;
                         } else {
-                            echo $comma . "'". $resource['name'] . "'";
+                            echo $comma . json_encode($resource['name']);
                         }
                         $prev_type = $resource['media_type'];
                         $comma = ",";
@@ -837,6 +837,8 @@ class WikiElement extends Element implements CrawlConstants
                     $name = $resource['name'];
                     $hash_id = L\crawlHash($data['PAGE_ID'] . urlencode($name) .
                         ($data['ORIGINAL_SUB_PATH'] ?? ""));
+                    $hash2_id = L\crawlHash($data['PAGE_ID'] . $name .
+                        ($data['ORIGINAL_SUB_PATH'] ?? ""));
                     if (!empty($data['RESOURCE_FILTER'])&&
                         mb_stripos($name, $data['RESOURCE_FILTER']) === false) {
                         continue;
@@ -929,7 +931,7 @@ class WikiElement extends Element implements CrawlConstants
                     if (!empty($_SESSION['seen_media']) &&
                         in_array($hash_id, $_SESSION['seen_media'])) {
                         e("<td class='sidebar-color huge-font'><span " .
-                            "id='$hash_id' class='marked' onclick='" .
+                            "id='$hash2_id' class='marked' onclick='" .
                             "clearResource(this.id, \"". $clear_url . "\")' ".
                             ">&diams;</span></td>");
                     } else {
ViewGit