Fix #615 SEO compatibility with third-party modules using their own $oDocument

This commit is contained in:
Kijin Sung 2016-10-23 15:05:11 +09:00
parent b257ef2b83
commit eb467b5799

View file

@ -403,7 +403,7 @@ class HTMLDisplayHandler
if ($document_srl)
{
$oDocument = Context::get('oDocument') ?: getModel('document')->getDocument($document_srl, false, false);
if ($oDocument instanceof documentItem && $oDocument->document_srl == $document_srl && !$oDocument->isSecret())
if (is_object($oDocument) && $oDocument->document_srl == $document_srl && (!method_exists($oDocument, 'isSecret') || !$oDocument->isSecret()))
{
$page_type = 'article';
}