mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-22 21:22:40 +00:00
Make parent re-association on context clone more restrictive
This commit is contained in:
parent
18d52ea402
commit
70443a5264
2 changed files with 4 additions and 3 deletions
|
@ -9,6 +9,7 @@ namespace JKingWeb\Arsse\Context;
|
||||||
use JKingWeb\Arsse\Misc\Date;
|
use JKingWeb\Arsse\Misc\Date;
|
||||||
|
|
||||||
class Context extends ExclusionContext {
|
class Context extends ExclusionContext {
|
||||||
|
/** @var ExclusionContext */
|
||||||
public $not;
|
public $not;
|
||||||
public $reverse = false;
|
public $reverse = false;
|
||||||
public $limit = 0;
|
public $limit = 0;
|
||||||
|
|
|
@ -32,9 +32,9 @@ class ExclusionContext {
|
||||||
|
|
||||||
public function __clone() {
|
public function __clone() {
|
||||||
if ($this->parent) {
|
if ($this->parent) {
|
||||||
$p = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS | \DEBUG_BACKTRACE_PROVIDE_OBJECT, 2)[1]['object'] ?? null;
|
$t = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS | \DEBUG_BACKTRACE_PROVIDE_OBJECT, 2)[1];
|
||||||
if ($p instanceof self) {
|
if (($t['object'] ?? null) instanceof self && $t['function'] === "__clone") {
|
||||||
$this->parent = $p;
|
$this->parent = $t['object'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue