bugfix: query serialization edge case

it did break when a "+" was present in the url, a rawurlencode was added, it is backward compatible because for pre-existing string, there is no % present so the unserialization's rawurldecode is without BC effect.

SVN:trunk[5709]
This commit is contained in:
Bruno Da Silva
2018-04-20 13:54:53 +00:00
parent aa4416ac4e
commit ef7a9ff02e

View File

@@ -245,7 +245,7 @@ abstract class DBSearch
public function serialize($bDevelopParams = false, $aContextParams = null)
{
$sOql = $this->ToOql($bDevelopParams, $aContextParams);
return base64_encode(serialize(array($sOql, $this->GetInternalParams(), $this->m_aModifierProperties)));
return rawurlencode(base64_encode(serialize(array($sOql, $this->GetInternalParams(), $this->m_aModifierProperties))));
}
/**
@@ -255,7 +255,7 @@ abstract class DBSearch
*/
static public function unserialize($sValue)
{
$aData = unserialize(base64_decode($sValue));
$aData = unserialize(base64_decode(rawurldecode($sValue)));
$sOql = $aData[0];
$aParams = $aData[1];
// We've tried to use gzcompress/gzuncompress, but for some specific queries