]> git.corax.cc Git - toolbox-restapis/commit
include/gitlab: Make urlencode function more extensible
authorMatthias Kruk <m@m10k.eu>
Sun, 5 Jun 2022 23:57:48 +0000 (08:57 +0900)
committerMatthias Kruk <m@m10k.eu>
Sun, 5 Jun 2022 23:57:48 +0000 (08:57 +0900)
commitd2c874140e481f56abbd625f468323060ce1b118
tree95e9e760e868e67d1cff9495b7fb032092540488
parent1582e47c6daaf19e671a1ee6147f446d27ec55b6
include/gitlab: Make urlencode function more extensible

Because _gitlab_urlencode() is a simple string replacement, it is
not very extensible and does not handle more than one replacement.

This commit rewrites _gitlab_urlencode() to use an associative
array to store replacement patterns, allowing the function to be
easily extended. For testing, this commit also adds a pattern to
escape comma (',') characters in URLs.
include/gitlab.sh