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
parent
10822a22b3
commit
260ee2a283
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue