Skip to content

Commit

Permalink
allow some URL encodings for descriptions in tokenregister.cgi (#83)
Browse files Browse the repository at this point in the history
Co-authored-by: Jens Maus <mail@jens-maus.de>
  • Loading branch information
Weseler485 and jens-maus authored Nov 8, 2023
1 parent 34e6744 commit 7fe5d18
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions xmlapi/tokenregister.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,27 @@ if {[info exists sid] && [check_session $sid]} {
foreach pair $pairs {
if {0 != [regexp "^desc=(.*)$" $pair dummy val]} {
set desc $val

# replace URL encoded parts
regsub -all {%20} $desc { } desc
regsub -all {%21} $desc {!} desc
regsub -all {%23} $desc {#} desc
regsub -all {%25} $desc {%} desc
regsub -all {%25} $desc {%} desc
regsub -all {%2A} $desc * desc
regsub -all {%2F} $desc {/} desc
regsub -all {%3F} $desc {?} desc
regsub -all {%5E} $desc {^} desc
regsub -all {%3D} $desc {=} desc
regsub -all {%2C} $desc {,} desc

# disable certain invalid chars
regsub -all {%3C} $desc {_} desc
regsub -all {<} $desc {_} desc
regsub -all {%3E} $desc {_} desc
regsub -all {>} $desc {_} desc
regsub -all {%27} $desc {_} desc
regsub -all {'} $desc {_} desc
break
}
}
Expand Down

0 comments on commit 7fe5d18

Please # to comment.