mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-09 19:45:13 +02:00
11 lines
373 B
Ruby
11 lines
373 B
Ruby
# Phase 04 (Track J.2) — Ruby ERB benign control fixture.
|
|
#
|
|
# Escapes ERB markers in the body before rendering through a fixed
|
|
# template that interpolates only the sanitised value, so SSTI-shaped
|
|
# input cannot reach the evaluator.
|
|
require 'erb'
|
|
|
|
def run(body)
|
|
safe_body = body.gsub(/<%/, '<%').gsub(/%>/, '%>')
|
|
ERB.new('<%= safe_body %>').result(binding)
|
|
end
|