From: <var...@us...> - 2014-11-25 16:12:11
|
Revision: 9374 http://sourceforge.net/p/phpwiki/code/9374 Author: vargenau Date: 2014-11-25 16:12:04 +0000 (Tue, 25 Nov 2014) Log Message: ----------- Simplify function obj2hash Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-11-25 16:03:47 UTC (rev 9373) +++ trunk/lib/stdlib.php 2014-11-25 16:12:04 UTC (rev 9374) @@ -71,7 +71,7 @@ phpwiki_version () isWikiWord ($word) - obj2hash ($obj, $exclude = false, $fields = false) + obj2hash($obj, $exclude = array()) url_get_contents ($uri) GenerateId ($name) firstNWordsOfContent ($n, $content) @@ -1699,13 +1699,13 @@ } // needed to store serialized objects-values only (perm, pref) -function obj2hash($obj, $exclude = false, $fields = false) +function obj2hash($obj, $exclude = array()) { $a = array(); - if (!$fields) $fields = get_object_vars($obj); + $fields = get_object_vars($obj); foreach ($fields as $key => $val) { - if (is_array($exclude)) { - if (in_array($key, $exclude)) continue; + if (in_array($key, $exclude)) { + continue; } $a[$key] = $val; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |