]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* Escape shashes in page titles entered in the blog post form.
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 31 Dec 2006 20:50:22 +0000 (20:50 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 31 Dec 2006 20:50:22 +0000 (20:50 +0000)
* Munge openids of the form somehost.com/user (trial, may revert)

IkiWiki/CGI.pm
debian/changelog
doc/bugs/Convert___34__somehost.com/user__34___OpenID_at_RecentChanges_page.mdwn

index 7f84f345a23e153074f3ff8b9c9db52c39871dd7..83ed959c02a9d1d7d90fdc1ec8195f76f1608703 100644 (file)
@@ -634,6 +634,7 @@ sub cgi (;$$) { #{{{
        }
        elsif ($do eq 'blog') {
                my $page=titlepage(decode_utf8($q->param('title')));
        }
        elsif ($do eq 'blog') {
                my $page=titlepage(decode_utf8($q->param('title')));
+               $page=~s/(\/)/"__".ord($1)."__"/eg; # escape slashes too
                # if the page already exists, munge it to be unique
                my $from=$q->param('from');
                my $add="";
                # if the page already exists, munge it to be unique
                my $from=$q->param('from');
                my $add="";
@@ -665,6 +666,10 @@ sub userlink ($) { #{{{
                if ($display !~ /\[/) {
                        $display=~s/^(.*?)\.([^.]+\.[a-z]+)$/$1 [$2]/;
                }
                if ($display !~ /\[/) {
                        $display=~s/^(.*?)\.([^.]+\.[a-z]+)$/$1 [$2]/;
                }
+               # Convert "somehost.com/user" to "user [somehost.com]".
+               if ($display !~ /\[/) {
+                       $display=~s/^(.+)\/[^\/](.+)$/$2 [$1]/;
+               }
                $display=~s!^https?://!!; # make sure this is removed
                return "<a href=\"$user\">".escapeHTML($display)."</a>";
        }
                $display=~s!^https?://!!; # make sure this is removed
                return "<a href=\"$user\">".escapeHTML($display)."</a>";
        }
index 0735c2db7091969100636f9e61855528e41b94e4..622b8f8d05863eaba7743d203859f3735bed099a 100644 (file)
@@ -23,8 +23,10 @@ ikiwiki (1.37) UNRELEASED; urgency=low
   * If a userdir is configured, links to pages in it can be made without
     specifying the path. This allows for easy signing of comments by linking
     to your page in the userdir.
   * If a userdir is configured, links to pages in it can be made without
     specifying the path. This allows for easy signing of comments by linking
     to your page in the userdir.
+  * Escape shashes in page titles entered in the blog post form.
+  * Munge openids of the form somehost.com/user (trial, may revert)
 
 
- -- Joey Hess <joeyh@debian.org>  Fri, 29 Dec 2006 00:26:47 -0500
+ -- Joey Hess <joeyh@debian.org>  Sun, 31 Dec 2006 15:30:59 -0500
 
 ikiwiki (1.36) unstable; urgency=low
 
 
 ikiwiki (1.36) unstable; urgency=low
 
index efb71e725c1993fd3283564b7d073796b448c78e..99c06d860d70486d24157c8c25a134570ac6eca5 100644 (file)
@@ -5,6 +5,9 @@ Could you also please convert "somehost.com/user" OpenID to
 for "user.somehost.com" OpenIDs. I think that same display form
 for all OpenIDs is a good idea. What's your opinion?
 
 for "user.somehost.com" OpenIDs. I think that same display form
 for all OpenIDs is a good idea. What's your opinion?
 
+> It's probably ok to do this, although there's the potential it might
+> misfire on some url. I've implemented it on a trial basis. --[[Joey]]
+
 BTW, Happy New Year for you and Debian 'etch' and all ikiwiki
 users! :) --Pawel
 
 BTW, Happy New Year for you and Debian 'etch' and all ikiwiki
 users! :) --Pawel
 
@@ -15,5 +18,9 @@ users! :) --Pawel
 >>> Sorry for confusing! I meant two files (directory and page),
 >>> instead of one (page).
 
 >>> Sorry for confusing! I meant two files (directory and page),
 >>> instead of one (page).
 
+>>>> Yep, fixed. --[[Joey]]
+
 >>> BTW, I have some problems with singing in using getopenid.com
 >>> BTW, I have some problems with singing in using getopenid.com
->>> server, so I also use myopenid.com server :) --Pawel
\ No newline at end of file
+>>> server, so I also use myopenid.com server :) --Pawel
+
+>>>> They were having some glitches last week.. --[[Joey]]