Skip to content

Commit

Permalink
Generate sortable tag signature with serialized array values in modEl…
Browse files Browse the repository at this point in the history
…ement
  • Loading branch information
opengeek committed Aug 20, 2019
1 parent 467da93 commit 87fd2a1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/src/Revolution/modElement.php
Expand Up @@ -268,16 +268,18 @@ protected function isStaticFilesAutomated()
public function getTag()
{
if (empty($this->_tag)) {
$propTemp = [];
if (empty($this->_propertyString) && !empty($this->_properties)) {
$propTemp = array();
foreach ($this->_properties as $key => $value) {
$key = trim($key);
if (is_scalar($value)) {
$propTemp[] = trim($key) . '=`' . $value . '`';
$propTemp[$key] = $key . '=`' . $value . '`';
} else {
$propTemp[] = trim($key) . '=`' . md5(uniqid(rand(), true)) . '`';
$propTemp[$key] = $key . '=`' . (is_array($value) ? json_encode($value) : md5(uniqid(rand(), true))) . '`';
}
}
if (!empty($propTemp)) {
ksort($propTemp);
$this->_propertyString = '?' . implode('&', $propTemp);
}
}
Expand Down

0 comments on commit 87fd2a1

Please sign in to comment.