[clang] [Static analysis] Encodes a filename before inserting it into a URL. (PR #120810)

Rashmi Mudduluru via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 9 10:49:09 PST 2025


================
@@ -1465,6 +1466,17 @@ sub HtmlEscape {
   return $tmp;
 }
 
+##----------------------------------------------------------------------------##
+# URLEscape - encode characters that are special in URLs
+##----------------------------------------------------------------------------##
+
+sub URLEscape {
+  my $arg = shift || '';
+  my $tmp = $arg;
+  $tmp =~ s/\+/%2B/g;
----------------
t-rasmud wrote:

Why is an additional variable `$tmp` needed? Can't this just be `$arg =~ s/\+/%2B/g;`?

https://github.com/llvm/llvm-project/pull/120810


More information about the cfe-commits mailing list