Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F847838
D266.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Apr 19, 6:55 PM
Size
1 KB
Mime Type
text/x-diff
Expires
Sun, Apr 20, 6:55 PM (11 m, 59 s)
Engine
blob
Format
Raw Data
Handle
602626
Attached To
D266: INP-1646 - Handle dynamic parameter names during "m_Param" tag compilation
D266.diff
View Options
Index: branches/5.2.x/core/kernel/nparser/ntags.php
===================================================================
--- branches/5.2.x/core/kernel/nparser/ntags.php
+++ branches/5.2.x/core/kernel/nparser/ntags.php
@@ -415,17 +415,17 @@
$capture_params['name'] = '__capture_' . $param_name;
$capture_to_pass = $this->Parser->CompileParamsArray($capture_params);
- $code[] = "if (isset(\$_parser->Captures['{$param_name}'])) {";
+ $code[] = "if (isset(\$_parser->Captures[\"{$param_name}\"])) {";
$code[] = "\t\${$param_name} = \$_parser->ParseBlock($capture_to_pass);";
- $code[] = "\t\$params['{$param_name}'] = \${$param_name};";
- $code[] = "\t\$tmp_{$param_name} = \${$param_name};";
+ $code[] = "\t\$params[\"{$param_name}\"] = \${$param_name};";
+ $code[] = "\t\$_param_value = \${$param_name};";
$code[] = "}";
$code[] = "else {";
$to_pass = $this->Parser->CompileParamsArray($tag['NP']);
$code[] = "\t" . '$_p_ =& $_parser->GetProcessor(\'m\');';
$code[] = "\t" . '$_tag_params = ' . $to_pass . ';';
- $code[] = "\t\$tmp_{$param_name} = \$_p_->PostProcess(\${$param_name}, \$_p_->PreparePostProcess(\$_tag_params));";
+ $code[] = "\t\$_param_value = \$_p_->PostProcess(\${$param_name}, \$_p_->PreparePostProcess(\$_tag_params));";
$code[] = "}";
if ( array_key_exists('result_to_var', $tag['NP']) && $tag['NP']['result_to_var'] ) {
@@ -439,10 +439,10 @@
$code[] = "\$params['{$result_to_var}'] = \${$result_to_var};";
}
elseif ( array_key_exists('plus', $tag['NP']) ) {
- $code[] = "\$tmp_{$param_name} += {$tag['NP']['plus']};";
+ $code[] = "\$_param_value += {$tag['NP']['plus']};";
}
- $code[] = "echo (\$tmp_{$param_name});";
+ $code[] = "echo (\$_param_value);";
$this->AppendCode($o, $code);
Event Timeline
Log In to Comment