fix urlencoding

This commit is contained in:
larshp 2017-07-23 12:41:19 +00:00
parent 5ff0cd9586
commit e84358ae27
2 changed files with 30 additions and 2 deletions

View File

@ -92,6 +92,11 @@ CLASS lcl_html_action_utils DEFINITION FINAL.
ev_seed TYPE string
RAISING lcx_exception.
PRIVATE SECTION.
CLASS-METHODS unescape
IMPORTING iv_string TYPE string
RETURNING VALUE(rv_string) TYPE string.
ENDCLASS. "lcl_html_action_utils DEFINITION
*----------------------------------------------------------------------*
@ -124,11 +129,11 @@ CLASS lcl_html_action_utils IMPLEMENTATION.
field-name = substring_before( val = <substring>
sub = '=' ).
field-name = cl_http_utility=>unescape_url( field-name ).
field-name = unescape( field-name ).
field-value = substring_after( val = <substring>
sub = '=' ).
field-value = cl_http_utility=>unescape_url( field-value ).
field-value = unescape( field-value ).
INSERT field INTO TABLE rt_fields.
@ -136,6 +141,15 @@ CLASS lcl_html_action_utils IMPLEMENTATION.
ENDMETHOD.
METHOD unescape.
* do not use cl_http_utility as it does strange things with the encoding
rv_string = iv_string.
* todo, more to be added here
REPLACE ALL OCCURRENCES OF '%3F' IN rv_string WITH '?'.
ENDMETHOD.
METHOD parse_fields_upper_case_name.
rt_fields = parse_fields( iv_string ).

View File

@ -1779,6 +1779,7 @@ CLASS ltcl_html_action_utils DEFINITION FOR TESTING RISK LEVEL HARMLESS
METHODS get_field FOR TESTING.
METHODS parse_fields_simple_case FOR TESTING.
METHODS parse_fields_advanced_case FOR TESTING.
METHODS parse_fields_unescape FOR TESTING.
METHODS parse_fields_german_umlauts FOR TESTING.
PRIVATE SECTION.
@ -1917,6 +1918,19 @@ CLASS ltcl_html_action_utils IMPLEMENTATION.
ENDMETHOD.
METHOD parse_fields_unescape.
* file status = '?', used in staging page
_given_string_is( '/SRC/ZFOOBAR.PROG.ABAP=%3F' ).
_when_fields_are_parsed( ).
_then_fields_should_be( index = 1
name = '/SRC/ZFOOBAR.PROG.ABAP'
value = '?' ).
ENDMETHOD.
METHOD parse_fields_german_umlauts.
DATA: ae TYPE string,