[asterisk-bugs] [JIRA] (ASTERISK-23911) URIENCODE/URIDECODE: WARNING about passing an empty string is a bit over zealous

Jonathan Rose (JIRA) noreply at issues.asterisk.org
Tue Jul 15 12:35:56 CDT 2014


     [ https://issues.asterisk.org/jira/browse/ASTERISK-23911?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Rose closed ASTERISK-23911.
------------------------------------


> URIENCODE/URIDECODE: WARNING about passing an empty string is a bit over zealous
> --------------------------------------------------------------------------------
>
>                 Key: ASTERISK-23911
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-23911
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Functions/func_uri
>            Reporter: Matt Jordan
>
> A common usage of {{URIENCODE}}/{{URIDECODE}} is to escape arguments passed to applications. This is particularly useful when said arguments contain delimeters that might otherwise be interpreted by the application itself.
> Sometimes, however, the variable being escaped is empty. That isn't an error - in that case, we don't have any parameter that we want to pass to the application. However, currently when this occurs, URIENCODE complains mightily:
> {code}
> WARNING[4943]: func_uri.c:79 uriencode: Syntax: URIENCODE(<data>) - missing argument!
> {code}
> Working around this is cumbersome in the dialplan. This:
> {code}
> same => n,Stasis(myapp,${URIENCODE(${ARGS}))
> {code}
> Becomes:
> {code}
> same => n,GotoIf($[${LEN(${ARGS})} = 0]skip:)
> same => n,Set(ARGS=${URIENCODE(${ARGS})})
> same => n(skip),NoOp()
> same => n,Stasis(MyApp,${ARGS})
> {code}
> Which is way more convoluted than just ignoring the empty string in the first place.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list