From: Jonny B. <jo...@ti...> - 2010-08-22 09:59:25
|
I've come up against this kind of thing before too - php unserialize doesn't seem to really know if it succeeded or not (from php.net: "In case the passed string is not unserializeable, FALSE is returned and E_NOTICE is issued.") Trouble is, false might be a valid value and i don't think notices are trappable (are they?). I've tinkered a couple of times with line 40 of prefslib.php - not sure if that helps but i think that's where the root if the issue might lie. Maybe doing better tests on the string to see if it's likely to be a serialised value might help? Good luck! :) jb On 21 Aug 2010, at 14:35, Nelson Ko wrote: > I am missing the context of this, but in lib/prefs/available, I notice > that the available_styles pref is a multilist pref type. The default > in lib/setup/prefs.php is array(), so it thinks it should find an > array in the value, hence it should unserialize. > > I can think of the following ways that could solve this (not sure > which is the best). > > 1) just set the pref to one or more options (e.g. All) and it should > be ok. What's the pref set to right now in the UI now anyway? > > 2) Have the if below check that $modified[$p] is_array, but this is > sort of a plaster approach may hide an underlying issue (or not...) > > Nelson > > On Fri, Aug 20, 2010 at 9:14 PM, Michael Risch <ri...@la...> wrote: >> I've tracked it down to the "available_styles" pref ($p). $modified[$p] echoes as 0 which, according to the code: >> if ( isset($modified[$p]) && ! is_array($modified[$p]) ) $modified[$p] = unserialize($modified[$p]); >> >> is set, and is not an array, but it is also not unserializing. I have no idea what the setting should look like or why there is an error - maybe whoever created that pref will know what I'm talking about. >> >> Regards, >> Michael Risch >> Associate Professor of Law >> Villanova University School of Law >> >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by >> >> Make an app they can't live without >> Enter the BlackBerry Developer Challenge >> http://p.sf.net/sfu/RIM-dev2dev >> _______________________________________________ >> Tikiwiki-devel mailing list >> Tik...@li... >> https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel >> > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > Tikiwiki-devel mailing list > Tik...@li... > https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel |