problems passing base64_encoded value |
(03-25-2021, 02:50 AM)craig Wrote: I would use the Text helper for this purpose to avoid URL issues with Base64; it uses bin2hex() on the result of random_bytes() instead of base64_encode().Sadly, bin2hex takes up a lot more space -- it doubles the length of whatever you encode. Also, I think there's a bug in site_url (or more specifically the URI class) and how it deals with your query string. Turns out CI4 will urlencode your query string whether you like it or not: PHP Code: // slash in query string gets encoded: PHP Code: $v = '%'; The + char, in particular, has problems. site_url returns the exact same url for both $url1 and $url2: PHP Code: $url1 = '?x=2+2'; Call me crazy, but I don't think site_url should be urldecoding your path segments or urlencoding your query strings. Furthermore, it's urlencoding behavior is unpredictable. |
Messages In This Thread |
problems passing base64_encoded value - by sneakyimp - 03-24-2021, 09:10 PM
RE: problems passing base64_encoded value - by craig - 03-25-2021, 02:50 AM
RE: problems passing base64_encoded value - by sneakyimp - 03-26-2021, 03:24 PM
|