User "Brion VIBBER" posted a comment on MediaWiki.r91106.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/91106#c19284
Commit summary:

Add wfUnserialize() wrapper around unserialize to prevent E_NOTICE and use it 
in ExifBitmap.php. There are probably many more places that could use this. 
This should fix Platonides' problem at r90421, but also added a check for 
$wgShowExif to prevent the test from failing.

Comment:

In this particular case we don't need generic validation/error handling for our 
expected cases, since there's a particular symbolic value we're looking for 
that indicates we shouldn't try to unserialize. :)

But some others check to see if the item could be unserialized and then have 
some error-handling code (skip this item, recalculate, whatever). This might 
feel clearer with a wfUnserialize() wrapper that suppresses the notice on 
failure '''but throws an exception''' -- which can be caught by callers that 
need error recovery, or left to kill the process & log the exception for cases 
that weren't expecting it.

_______________________________________________
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to