Index: typo3/sysext/indexed_search/mod/index.php =================================================================== --- typo3/sysext/indexed_search/mod/index.php (revision 7131) +++ typo3/sysext/indexed_search/mod/index.php (working copy) @@ -27,7 +27,7 @@ /** * Module: Indexing Engine Overview * - * @author Kasper Skårhøj + * @author Kasper Sk�rh�j */ /** * [CLASS/FUNCTION INDEX of SCRIPT] @@ -317,7 +317,6 @@ $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*) AS pcount,index_phash.*', 'index_phash', 'data_page_id!=0', 'phash_grouping,phash,cHashParams,data_filename,data_page_id,data_page_reg1,data_page_type,data_page_mp,gr_list,item_type,item_title,item_description,item_mtime,tstamp,item_size,contentHash,crdate,parsetime,sys_language_uid,item_crdate,externalUrl,recordUid,freeIndexUid,freeIndexSetId', 'data_page_id'); while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { - $cHash = count(unserialize($row["cHashParams"])) ? $this->formatCHash(unserialize($row["cHashParams"])) : ""; $grListRec = $this->getGrlistRecord($row["phash"]); $recList[] = array( $row["data_page_id"].($row["data_page_type"]?"/".$row["data_page_type"]:""), @@ -331,7 +330,7 @@ $this->getNumberOfSections($row["phash"])."/".$grListRec[0]["pcount"]."/".$this->getNumberOfFulltext($row["phash"]), $row["pcount"]."/".$this->formatFeGroup($grListRec), $row["sys_language_uid"], - $cHash, + $this->getChashDataString($row['cHashParams']), $row["phash"] ); @@ -445,18 +444,16 @@ } /** - * [Describe function...] + * Creates a key/value pair representation for the passed parameters * - * @param [type] $arr: ... - * @return [type] ... + * @param array $data + * @return string */ - function formatCHash($arr) { - reset($arr); - $list=array(); - while(list($k,$v)=each($arr)) { - $list[]=$k."=".$v; + protected function formatCHash(array $data) { + foreach ($data as $key => $value) { + $list[] = htmlspecialchars($key) . '=' . htmlspecialchars($value); } - return implode("
",$list); + return implode('
', $list); } /** @@ -551,6 +548,21 @@ } return count($items); } + + /** + * Produces cHash information from the serialized cHash data + * + * @param string $serializedData + * @return string + */ + protected function getChashDataString($serializedData) { + $result = ''; + $cHashData = @unserialize($serializedData['cHashParams'']); + if (is_array($cHashData)) { + $result = $this->formatCHash($cHashData); + } + return $result; + } }