Make the create page link work better with underscoring, a=chris

Chris Pollett [2022-07-11 19:Jul:th]
Make the create page link work better with underscoring, a=chris
Filename
src/controllers/components/SocialComponent.php
src/views/elements/WikiElement.php
diff --git a/src/controllers/components/SocialComponent.php b/src/controllers/components/SocialComponent.php
index 5b5e2facc..6f5e06086 100644
--- a/src/controllers/components/SocialComponent.php
+++ b/src/controllers/components/SocialComponent.php
@@ -3207,7 +3207,8 @@ class SocialComponent extends Component implements CrawlConstants
                     }
                     $data["LIMIT"] = $limit;
                     $data["RESULTS_PER_PAGE"] = $num;
-                    $data["FILTER"] = preg_replace("/\s+/u", "_", $filter);
+                    $data["FILTER"] = preg_replace("/\s+/u", " ", $filter);;
+                    $filter = preg_replace("/\s+/u", "_", $filter);
                     $search_page_info = false;
                     if ($filter != "") {
                         $search_page_info = $group_model->getPageInfoByName(
diff --git a/src/views/elements/WikiElement.php b/src/views/elements/WikiElement.php
index 830f59f69..e77c62a5c 100644
--- a/src/views/elements/WikiElement.php
+++ b/src/views/elements/WikiElement.php
@@ -1597,8 +1597,9 @@ class WikiElement extends Element implements CrawlConstants
             "";
         $group_id = $data["GROUP"]["GROUP_ID"];
         $controller = $data['CONTROLLER'];
-        $create_query = htmlentities(B\wikiUrl($data["FILTER"], true,
-            $controller, $group_id)) . $token_string . "&arg=edit";
+        $create_query = htmlentities(B\wikiUrl(preg_replace("/\s+/u", "_",
+            $data["FILTER"]), true, $controller, $group_id)) . $token_string .
+            "&arg=edit";
         $paging_query = htmlentities(B\wikiUrl("pages", true, $controller,
             $group_id)) . $token_string;
         if (!empty($data['FILTER'])) {
ViewGit