Skip to content

Commit

Permalink
Avoid reparsing of layout XML when not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
nussjustin authored Mar 29, 2017
1 parent f0da16a commit fba8b55
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/code/community/Lesti/Fpc/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,13 @@ protected function _prepareLayout(
array $dynamicBlocks
)
{
$xml = simplexml_load_string(
$layout->getXmlString(),
Lesti_Fpc_Helper_Data::LAYOUT_ELEMENT_CLASS
);
$xml = $layout->getNode();
if (!is_a($xml, Lesti_Fpc_Helper_Data::LAYOUT_ELEMENT_CLASS)) {
$xml = simplexml_load_string(
$layout->getXmlString(),
Lesti_Fpc_Helper_Data::LAYOUT_ELEMENT_CLASS
);
}
$cleanXml = simplexml_load_string(
'<layout/>',
Lesti_Fpc_Helper_Data::LAYOUT_ELEMENT_CLASS
Expand Down

0 comments on commit fba8b55

Please sign in to comment.