[ 
https://issues.apache.org/jira/browse/SOLR-17255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chris M. Hostetter resolved SOLR-17255.
---------------------------------------
    Fix Version/s: main (10.0)
                   9.7
       Resolution: Fixed

> ClientUtils.encodeLocalParamVal doesn't work with param refs, breaks 
> SolrParams.toLocalParamsString
> ---------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-17255
>                 URL: https://issues.apache.org/jira/browse/SOLR-17255
>             Project: Solr
>          Issue Type: Bug
>          Components: SolrJ
>            Reporter: Chris M. Hostetter
>            Assignee: Chris M. Hostetter
>            Priority: Major
>             Fix For: main (10.0), 9.7
>
>         Attachments: SOLR-17255.patch
>
>
> If you try to use {{SolrParams.toLocalParamsString}} where some of your param 
> values are {{$other_param}} style param references, those refs will wind up 
> wrapped in single quotes, preventing the param de-referencing from working.
> Example...
> {code:java}
> final ModifiableSolrParams params = new ModifiableSolrParams();
> params.set("type", "edismax");
> params.set("v","$other_param");
> System.out.println(params.toLocalParamString())
> // Output: {! type=edismax v='$other_param'}
> {code}
> Ironically: {{ClientUtils.encodeLocalParamVal}} actually has a check to see 
> if the string starts with {{"$"}} which causes it to bypass a loop that 
> checks to see if the string needs to be quoted – but bypassing that loop 
> doesn't leave the method variables ({{{}i{}}} and {{{}len{}}}) in a state 
> that allow the subsequent short-circut check (which returns the original 
> value) to kick in – so the value is always falls through to the {{// We need 
> to enclose in quotes... but now we need to escape}} logic
> (It looks like this bug has always existed in every version of these methods)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to