Closed aelgoa closed 8 years ago
I can reproduce this. Same error for me.
I get the same issue too. Any ideas what can be done to fix it yet?
Looks like it's related to base64 encoding, 3rd party Base64 decode + LZString.decompress work correctly (so far at least, the original issue doesn't have 100% reproducibility).
If you're passing the base64 data directly via URL, the PHP decoding process replaces the pluses with spaces which are not valid base64 characters. You may need to retrieve the parameter from the query string, then replace any spaces with pluses before base64 decode or decodeFromBase64.
Escaping before passing the data may also resolve it.
Hi, i've completely rewritten the PHP component to match the current algorythm / ouput provided by the javascript component. The bug is fixed in version 1.1.0.
That's awesome - many thanks!! :+1: Definitely going to check this out.
Awesome. just tested the new version and all the (too much errors) were gone.
js: LZString.compressToBase64(document.getElementById('src').value); php: $s=LZString::decompressFromBase64($_POST['s']);
value is caught by PHP script as intented with correct value. error happens in decompression:
Notice: Uninitialized string offset: 1123 in D:\babs\8.5\root\wwide\LZString.php on line 354
Warning: strpos() [function.strpos]: Empty delimiter in D:\babs\8.5\root\wwide\LZString.php on line 354
Fatal error: Uncaught exception 'Exception' with message '$c != $dictSize (133,128)' in D:\babs\8.5\root\wwide\LZString.php:313 Stack trace:
0 D:\babs\8.5\root\wwide\LZString.php(380): LZString::decompress('???????????????...')
1 D:\babs\8.5\root\wwide\wwc.php(6): LZString::decompressFromBase64('MQSwdgxgNgrgJgU...')
2 {main}
thrown in D:\babs\8.5\root\wwide\LZString.php on line 313