Skip to content

Commit f96ad3e

Browse files
authored
Revert passing script variables by reference (#16030)
#15578 added the EXTR_REFS flag to the extract() function in modScript::process with the intention of allowing plugins to manipulated variables passed in to it. Unfortunately per https://community.modx.com/t/spform-how-to-change-language/4917/16 this is causing issues when local variables in a snippet share the name of a script property or a copy of $scriptProperties is made. This is causing wildly unexpected results.
1 parent 50c9223 commit f96ad3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/Revolution/modScript.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function process($properties = null, $content = null)
8484
$scriptProperties = $this->xpdo->event->params = $this->_properties; /* store params inside event object */
8585
ob_start();
8686
unset($properties, $content);
87-
extract($scriptProperties, EXTR_SKIP|EXTR_REFS);
87+
extract($scriptProperties, EXTR_SKIP);
8888
$includeResult = include $this->_scriptFilename;
8989
$includeResult = ($includeResult === null ? '' : $includeResult);
9090
if (ob_get_length()) {

0 commit comments

Comments
 (0)