mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
⬆️ N°4770 Update to latest Symfony 3.4
This commit is contained in:
@@ -48,8 +48,8 @@ class VarCloner extends AbstractCloner
|
||||
// or null if the original value is used directly
|
||||
|
||||
if (!self::$hashMask) {
|
||||
self::$gid = uniqid(mt_rand(), true); // Unique string used to detect the special $GLOBALS variable
|
||||
self::initHashMask();
|
||||
self::$gid = md5(dechex(self::$hashMask)); // Unique string used to detect the special $GLOBALS variable
|
||||
}
|
||||
$gid = self::$gid;
|
||||
$hashMask = self::$hashMask;
|
||||
@@ -120,7 +120,6 @@ class VarCloner extends AbstractCloner
|
||||
case \is_int($v):
|
||||
case \is_float($v):
|
||||
continue 2;
|
||||
|
||||
case \is_string($v):
|
||||
if ('' === $v) {
|
||||
continue 2;
|
||||
@@ -248,7 +247,7 @@ class VarCloner extends AbstractCloner
|
||||
$stub->position = $len++;
|
||||
} elseif ($pos < $maxItems) {
|
||||
if ($maxItems < $pos += \count($a)) {
|
||||
$a = \array_slice($a, 0, $maxItems - $pos);
|
||||
$a = \array_slice($a, 0, $maxItems - $pos, true);
|
||||
if ($stub->cut >= 0) {
|
||||
$stub->cut += $pos - $maxItems;
|
||||
}
|
||||
@@ -310,7 +309,7 @@ class VarCloner extends AbstractCloner
|
||||
private static function initHashMask()
|
||||
{
|
||||
$obj = (object) [];
|
||||
self::$hashOffset = 16 - PHP_INT_SIZE;
|
||||
self::$hashOffset = 16 - \PHP_INT_SIZE;
|
||||
self::$hashMask = -1;
|
||||
|
||||
if (\defined('HHVM_VERSION')) {
|
||||
@@ -318,7 +317,7 @@ class VarCloner extends AbstractCloner
|
||||
} else {
|
||||
// check if we are nested in an output buffering handler to prevent a fatal error with ob_start() below
|
||||
$obFuncs = ['ob_clean', 'ob_end_clean', 'ob_flush', 'ob_end_flush', 'ob_get_contents', 'ob_get_flush'];
|
||||
foreach (debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) as $frame) {
|
||||
foreach (debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS) as $frame) {
|
||||
if (isset($frame['function'][0]) && !isset($frame['class']) && 'o' === $frame['function'][0] && \in_array($frame['function'], $obFuncs)) {
|
||||
$frame['line'] = 0;
|
||||
break;
|
||||
@@ -331,6 +330,6 @@ class VarCloner extends AbstractCloner
|
||||
}
|
||||
}
|
||||
|
||||
self::$hashMask ^= hexdec(substr(spl_object_hash($obj), self::$hashOffset, PHP_INT_SIZE));
|
||||
self::$hashMask ^= hexdec(substr(spl_object_hash($obj), self::$hashOffset, \PHP_INT_SIZE));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user