X-Git-Url: http://pileus.org/git/?p=vpaste;a=blobdiff_plain;f=index.cgi;h=09e5c985d394b6307e4dc22c5c8350195e3aa603;hp=0b7859e77c74ccb4d2021509f6d58211da0ba887;hb=HEAD;hpb=caf550883fcfbd10cc1a470168f984f4a40672a6 diff --git a/index.cgi b/index.cgi index 0b7859e..09e5c98 100755 --- a/index.cgi +++ b/index.cgi @@ -116,7 +116,8 @@ function respond { function format { # Create a temp file with the provided modeline tmp="$(mktemp)" - sed "\$avim: $(get_modeline)" "$1" > "$tmp" + sed -e "1ivim: $(get_modeline)" \ + -e "\$avim: $(get_modeline)" "$1" > "$tmp" # Determine cache name md5="$(cat index.cgi vimrc "$tmp" /usr/bin/ex | md5sum -b)" @@ -136,7 +137,7 @@ function format { '+sil! set iconstring= ruf= stl= tal=' \ "+sil! set titlestring=$1\ -\ vpaste.net" \ '+sil! set noml' \ - '+sil! $d|'$2 \ + '+sil! 1d|$d|'$2 \ '+sil! %s/\r//g' \ '+sil! TOhtml' \ "+sav! $out" \ @@ -225,8 +226,9 @@ function do_upload { spam=$(echo -n "$body" | cut_file "ignoreme") text=$(echo -n "$body" | cut_file "(text|x)") bans=$(echo -n "$REMOTE_ADDR" | grep -f blacklist) - [ ! -z "$spam" ] && respond "Spam check.." - [ ! -z "$bans" ] && respond "You have been banned" + + [ ! -z "$spam" ] && respond -h "Status: 403 Forbidden" "Spam check.." + [ ! -z "$bans" ] && respond -h "Status: 403 Forbidden" "You have been banned" [ -z "$text" ] && respond "No text pasted" # Format and save message @@ -273,22 +275,16 @@ function do_help { + + +