Handle Edit |
|
|
Here we create an editor out of html forms.
There are a lot of forms-challenged browsers out there
so we watch out for a couple of known problems.
sub HandleEdit { $title = $CookedInput{edit} || $CookedInput{copy}; $title =~ /^$LinkPattern$/ || &AbortScript("edit: improper name: $title"); %old = &RetrievePage($title);Get the text or its copy as appropriate. $_ = $CookedInput{copy} ? $old{copy} : $old{text}; $note = 'Copy of ' if $CookedInput{copy};Some browsers for the Macintosh get confused by both CR and LF in an entry field. So we nix the CRs as we escape the usual html metacharacters. s/\r\n/\n/g; &EscapeMetaCharacters;IBM's WebExplorer expands any tabs we might send it. So we go ahead and check the space-to-tab conversion when we send it text. $convert = "checked" if $ENV{HTTP_USER_AGENT} =~ /WebExplorer/;
|
Last edited January 16, 2002 Return to WelcomeVisitors |