X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/39d78ce54c179aa02974eb7c112c6a8b62d74dd0..8c8ce06a1b267a5c5d0b1a4f2b229b6d15e63b71:/IkiWiki/CGI.pm diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index d23cf5d02..b1f770b05 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -46,6 +46,8 @@ sub page_locked ($$;$) { #{{{ if (pagespec_match($page, userinfo_get($admin, "locked_pages"))) { return 1 if $nonfatal; + #translators: The first parameter is a page name, + #translators: second is the user who locked it. error(sprintf(gettext("%s is locked by %s and cannot be edited"), htmllink("", "", $page, 1), userlink($admin))); @@ -127,8 +129,7 @@ sub cgi_signin ($$) { #{{{ params => $q, action => $config{cgiurl}, header => 0, - template => (-e "$config{templatedir}/signin.tmpl" ? - {template_params("signin.tmpl")} : ""), + template => scalar template_params("signin.tmpl"), stylesheet => baseurl()."style.css", ); my $buttons=["Login"]; @@ -196,8 +197,7 @@ sub cgi_prefs ($$) { #{{{ javascript => 0, params => $q, action => $config{cgiurl}, - template => (-e "$config{templatedir}/prefs.tmpl" ? - {template_params("prefs.tmpl")} : ""), + template => scalar template_params("prefs.tmpl"), stylesheet => baseurl()."style.css", ); my $buttons=["Save Preferences", "Logout", "Cancel"]; @@ -291,8 +291,7 @@ sub cgi_editpage ($$) { #{{{ params => $q, action => $config{cgiurl}, table => 0, - template => (-e "$config{templatedir}/editpage.tmpl" ? - {template_params("editpage.tmpl")} : ""), + template => scalar template_params("editpage.tmpl"), ); run_hooks(formbuilder_setup => sub { @@ -668,7 +667,7 @@ sub userlink ($) { #{{{ } # Convert "http://somehost.com/user" to "user [somehost.com]". if ($display !~ /\[/) { - $display=~s/^https?:\/\/(.+)\/[^\/](.+)$/$2 [$1]/; + $display=~s/^https?:\/\/(.+)\/([^\/]+)$/$2 [$1]/; } $display=~s!^https?://!!; # make sure this is removed return "".escapeHTML($display)."";