mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Escape value in custom search URL
git-svn-id: https://zxing.googlecode.com/svn/trunk@2580 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
bb7328d4b0
commit
4b124b109d
|
@ -41,6 +41,8 @@ import android.provider.ContactsContract;
|
|||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Collection;
|
||||
import java.util.Locale;
|
||||
|
||||
|
@ -518,6 +520,11 @@ public abstract class ResultHandler {
|
|||
if (customProductSearch == null) {
|
||||
return text; // ?
|
||||
}
|
||||
try {
|
||||
text = URLEncoder.encode(text, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// can't happen; UTF-8 is always supported. Continue, I guess, without encoding
|
||||
}
|
||||
String url = customProductSearch.replace("%s", text);
|
||||
if (rawResult != null) {
|
||||
url = url.replace("%f", rawResult.getBarcodeFormat().toString());
|
||||
|
|
Loading…
Reference in a new issue