Skip to content

Commit

Permalink
Removed old, almost unused and undocumented lib/Unserialize
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano committed Sep 24, 2024
1 parent 0a6d48a commit ceded0d
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 621 deletions.
17 changes: 3 additions & 14 deletions app/code/core/Mage/Core/Helper/String.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,23 +512,14 @@ public function uniOrd($c)
* UnSerialize string
* @param string $str
* @return mixed|null
* @throws Exception
*/
public function unserialize($str)
{
if (is_null($str)) {
return null;
}
$reader = new Unserialize_Reader_ArrValue('data');
$prevChar = null;
for ($i = 0; $i < strlen($str); $i++) {
$char = $str[$i];
$result = $reader->read($char, $prevChar);
if (!is_null($result)) {
return $result;
}
$prevChar = $char;
}

return unserialize($str);
}

/**
Expand All @@ -553,9 +544,7 @@ public function isSerializedArrayOrObject($data)
public function validateSerializedObject($str)
{
if ($this->isSerializedArrayOrObject($str)) {
try {
$this->unserialize($str);
} catch (Exception $e) {
if (!unserialize($str)) {
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Sales/Model/Quote/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ public function compare($item)
// dispose of some options params, that can cramp comparing of arrays
if (is_string($itemOptionValue) && is_string($optionValue)) {
try {
/** @var Unserialize_Parser $parser */
/** @var Mage_Core_Helper_UnserializeArray $parser */
$parser = Mage::helper('core/unserializeArray');

$_itemOptionValue =
Expand Down
48 changes: 0 additions & 48 deletions lib/Unserialize/Parser.php

This file was deleted.

111 changes: 0 additions & 111 deletions lib/Unserialize/Reader/Arr.php

This file was deleted.

70 changes: 0 additions & 70 deletions lib/Unserialize/Reader/ArrKey.php

This file was deleted.

89 changes: 0 additions & 89 deletions lib/Unserialize/Reader/ArrValue.php

This file was deleted.

Loading

0 comments on commit ceded0d

Please sign in to comment.