use md5sum for page_to_id

The munged ids were looking pretty nasty, and were not completly guaranteed
to be unique. So a md5sum seems like a better approach. (Would have used
sha1, but md5 is in perl core.)
master
Joey Hess 2009-03-27 13:44:31 -04:00
parent 10822a22b3
commit 260ee2a283
1 changed files with 3 additions and 6 deletions

View File

@ -819,13 +819,10 @@ sub page_to_id ($) {
# comment.
my $page=shift;
# It needs to start with a letter.
$page="comment_".$page;
eval q{use Digest::MD5 'md5_hex'};
error($@) if $@;
# Encode any illegal characters.
$page=~s/([^A-Za-z0-9-_:.])/"__".ord($1)."__"/eg;
return $page;
return "comment-".md5_hex($page);
}
package IkiWiki::PageSpec;