public static function lookupObject($pLookupHash) { if (!empty($pLookupHash['page_id'])) { $loadContentId = BitPage::findContentIdByPageId($pLookupHash['page_id']); } elseif (!empty($pLookupHash['content_id'])) { $loadContentId = $pLookupHash['content_id']; } elseif (!empty($pLookupHash['page'])) { //handle legacy forms that use plain 'page' form variable name //if page had some special enities they were changed to HTML for for security reasons. //now we deal only with string so convert it back - so we can support this case: //You&Me --(detoxify in kernel)--> You&Me --(now)--> You&Me //we could do htmlspecialchars_decode but it allows <> marks here, so we just transform & to & - it's not so scary. $loadPage = str_replace("&", "&", $pLookupHash['page']); // Fix nignx mapping of '+' sign when doing rewrite $loadPage = str_replace("+", " ", $loadPage); if ($loadPage && ($existsInfo = static::pageExists($loadPage))) { if (count($existsInfo)) { if (count($existsInfo) > 1) { // Perhaps something should be done on page conflicts } $loadPageId = $existsInfo[0]['page_id']; $loadContentId = $existsInfo[0]['content_id']; } } } if (!empty($loadContentId)) { $ret = static::getLibertyObject($loadContentId); } if (empty($ret) || !is_object($ret)) { $ret = new self(); } return $ret; }
* @subpackage functions */ /** * required setup */ require_once WIKI_PKG_PATH . 'BitBook.php'; global $gContent; include_once LIBERTY_PKG_PATH . 'lookup_content_inc.php'; // this is needed when the center module is applied to avoid abusing $_REQUEST if (empty($lookupHash)) { $lookupHash =& $_REQUEST; } // if we already have a gContent, we assume someone else created it for us, and has properly loaded everything up. if (empty($gContent) || !is_object($gContent) || strtolower(get_class($gContent)) != 'bitpage') { if (!empty($lookupHash['page_id'])) { $loadContentId = BitPage::findContentIdByPageId($lookupHash['page_id']); } elseif (!empty($lookupHash['content_id'])) { $loadContentId = $lookupHash['content_id']; } elseif (!empty($lookupHash['page'])) { //handle legacy forms that use plain 'page' form variable name //if page had some special enities they were changed to HTML for for security reasons. //now we deal only with string so convert it back - so we can support this case: //You&Me --(detoxify in kernel)--> You&Me --(now)--> You&Me //we could do htmlspecialchars_decode but it allows <> marks here, so we just transform & to & - it's not so scary. $loadPage = str_replace("&", "&", $lookupHash['page']); // Fix nignx mapping of '+' sign when doing rewrite $loadPage = str_replace("+", " ", $loadPage); if ($loadPage && ($existsInfo = BitPage::pageExists($loadPage))) { if (count($existsInfo)) { if (count($existsInfo) > 1) { // Display page so user can select which wiki page they want (there are multiple that share this name)