Fix casting issue by ensuring r.ctx_val is cast to a string before it used in a gsub operation. This prevents errors where sometimes the script can crash when r.ctx_val is considered to be a integer due to it containing only numbers and nothing else

This commit is contained in:
Grant Willcox
2022-02-16 20:05:19 -06:00
parent d7b442f782
commit 0ca56600a6
+1 -1
View File
@@ -242,7 +242,7 @@ $framework.modules.each do |name, mod|
new_ctx_val = "#{century}#{year}/#{ctx_val}"
uri = types[r.ctx_id.upcase].gsub(/\#{in_ctx_val}/, new_ctx_val)
else
uri = types[r.ctx_id.upcase].gsub(/\#{in_ctx_val}/, r.ctx_val)
uri = types[r.ctx_id.upcase].gsub(/\#{in_ctx_val}/, r.ctx_val.to_s)
end
if is_url_alive?(uri, http_timeout, is_url_alive_cache)