This is an automated email from the ASF dual-hosted git repository.

abernal pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git


The following commit(s) were added to refs/heads/master by this push:
     new 96d54b732 JSPWIKI-1181 - Fix: Correct URL generation for pages with 
special characters
     new 41f558601 Merge pull request #310 from arturobernalg/JSPWIKI-1181
96d54b732 is described below

commit 96d54b732487d71611ce9622d22e015fa6a24558
Author: Arturo Bernal <[email protected]>
AuthorDate: Sun Oct 1 14:22:58 2023 +0200

    JSPWIKI-1181 - Fix: Correct URL generation for pages with special characters
    
    The cleanPageName function has been updated to correctly handle the '/' 
character, resolving the issue where URLs for search results in quick 
navigation were incorrectly generated.
---
 ChangeLog.md                                             |  1 +
 .../src/main/java/org/apache/wiki/api/Release.java       |  2 +-
 jspwiki-war/src/main/scripts/wiki/Wiki.js                | 16 +++++++---------
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/ChangeLog.md b/ChangeLog.md
index 52f23d409..941e08062 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -23,6 +23,7 @@ under the License.
 
 * [JSPWIKI-1167](https://issues.apache.org/jira/browse/JSPWIKI-1167) - 
prettify: line numbering is wrong with longer lines
     Prettified code lines should not wrap around, to avoid mismatch with line 
numbering.
+* [JSPWIKI-1181](https://issues.apache.org/jira/browse/JSPWIKI-1167) - Search 
popup does not handle attachments correctly.
     
 **2023-09-09  Dirk Frederickx (brushed AT apache DOT org)**
 
diff --git a/jspwiki-api/src/main/java/org/apache/wiki/api/Release.java 
b/jspwiki-api/src/main/java/org/apache/wiki/api/Release.java
index b59013b1f..8662dedf9 100644
--- a/jspwiki-api/src/main/java/org/apache/wiki/api/Release.java
+++ b/jspwiki-api/src/main/java/org/apache/wiki/api/Release.java
@@ -69,7 +69,7 @@ public final class Release {
      *  <p>
      *  If the build identifier is empty, it is not added.
      */
-    public static final String     BUILD         = "02";
+    public static final String     BUILD         = "03";
 
     /**
      *  This is the generic version string you should use when printing out 
the version.  It is of
diff --git a/jspwiki-war/src/main/scripts/wiki/Wiki.js 
b/jspwiki-war/src/main/scripts/wiki/Wiki.js
index 6b9c432da..f19bfb0a7 100644
--- a/jspwiki-war/src/main/scripts/wiki/Wiki.js
+++ b/jspwiki-war/src/main/scripts/wiki/Wiki.js
@@ -528,16 +528,14 @@ var Wiki = {
     },
 
     /*
-    Property: cleanPageName
-        Remove all not-allowed chars from a pagename.
-        Trim all whitespace, allow letters, digits and punctuation chars: 
()&+, -=._$
-        Mirror of org.apache.wiki.parser.MarkupParser.cleanPageName()
-    */
-    cleanPageName: function( pagename ){
-
+      Property: cleanPageName
+          Remove all not-allowed chars from a pagename.
+          Trim all whitespace, allow letters, digits and punctuation chars: 
()&+, -=._$/ (Note: '/' is now allowed)
+          Mirror of org.apache.wiki.parser.MarkupParser.cleanPageName()
+  */
+    cleanPageName: function(pagename) {
         //\w is short for [A-Z_a-z0-9_]
-        return 
pagename.clean().replace(/[^\w\u00C0-\u1FFF\u2800-\uFFFD()&+,\-=.$ ]/g, "");
-
+        return 
pagename.clean().replace(/[^\w\u00C0-\u1FFF\u2800-\uFFFD()&+,\-=.$/ ]/g, "");
     },
 
     /*

Reply via email to