Author: leithoff
Date: Mon Nov 2 11:51:51 2009
New Revision: 28230
URL: http://www.egroupware.org/viewvc/egroupware?rev=28230&view=rev Log:
backport of Christian Binders patch: little helper for prefs if unserialize failed - this can happen if the pref comes from an installation with another charset than the current system charset, ported to handle config as well
Modified: branches/1.6/phpgwapi/inc/class.preferences.inc.php
URL: http://www.egroupware.org/viewvc/egroupware/branches/1.6/phpgwapi/inc/class.preferences.inc.php?rev=28230&r1=28229&r2=28230&view=diff ==============================================================================
--- branches/1.6/phpgwapi/inc/class.preferences.inc.php (original)
+++ branches/1.6/phpgwapi/inc/class.preferences.inc.php Mon Nov 2 11:51:51 2009
@@ -248,6 +248,11 @@
// The following replacement is required for PostgreSQL to work
$app = trim($row['preference_app']);
$value = unserialize($row['preference_value']);
+ if($value === false)
+ {
+ // manually retrieve the string lengths of the serialized array if unserialize failed
+ $value = unserialize(preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.mb_strlen('$2','8bit').':\"$2\";'", $row['preference_value']));
+ }
$this->unquote($value);
if (!is_array($value))
{
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference _______________________________________________
eGroupWare-cvs mailing list
eGroupWare-cvs@... https://lists.sourceforge.net/lists/listinfo/egroupware-cvs