mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG 7362 dont include trailing space in bare string
This commit is contained in:
parent
2664cb2d67
commit
e160b76df5
@ -392,6 +392,10 @@ after')
|
|||||||
$this->assertEquals('AD',
|
$this->assertEquals('AD',
|
||||||
$this->render('A<% if Right == Wrong %>B<% else_if RawVal != RawVal %>C<% end_if %>D'));
|
$this->render('A<% if Right == Wrong %>B<% else_if RawVal != RawVal %>C<% end_if %>D'));
|
||||||
|
|
||||||
|
// Bare words with ending space
|
||||||
|
$this->assertEquals('ABC',
|
||||||
|
$this->render('A<% if "RawVal" == RawVal %>B<% end_if %>C'));
|
||||||
|
|
||||||
// Else
|
// Else
|
||||||
$this->assertEquals('ADE',
|
$this->assertEquals('ADE',
|
||||||
$this->render('A<% if Right == Wrong %>B<% else_if RawVal != RawVal %>C<% else %>D<% end_if %>E'));
|
$this->render('A<% if Right == Wrong %>B<% else_if RawVal != RawVal %>C<% else %>D<% end_if %>E'));
|
||||||
@ -457,7 +461,7 @@ after')
|
|||||||
|
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
$this->render('<% include SSViewerTestIncludeWithArguments Arg1=A Bare String, Arg2=B Bare String %>'),
|
$this->render('<% include SSViewerTestIncludeWithArguments Arg1=A Bare String, Arg2=B Bare String %>'),
|
||||||
'<p>A Bare String</p><p>B Bare String </p>'
|
'<p>A Bare String</p><p>B Bare String</p>'
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
|
@ -1146,7 +1146,7 @@ class SSTemplateParser extends Parser {
|
|||||||
|
|
||||||
function Argument_FreeString(&$res, $sub) {
|
function Argument_FreeString(&$res, $sub) {
|
||||||
$res['ArgumentMode'] = 'string';
|
$res['ArgumentMode'] = 'string';
|
||||||
$res['php'] = "'" . str_replace("'", "\\'", $sub['text']) . "'";
|
$res['php'] = "'" . str_replace("'", "\\'", trim($sub['text'])) . "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ComparisonOperator: "==" | "!=" | "=" */
|
/* ComparisonOperator: "==" | "!=" | "=" */
|
||||||
|
@ -322,7 +322,7 @@ class SSTemplateParser extends Parser {
|
|||||||
|
|
||||||
function Argument_FreeString(&$res, $sub) {
|
function Argument_FreeString(&$res, $sub) {
|
||||||
$res['ArgumentMode'] = 'string';
|
$res['ArgumentMode'] = 'string';
|
||||||
$res['php'] = "'" . str_replace("'", "\\'", $sub['text']) . "'";
|
$res['php'] = "'" . str_replace("'", "\\'", trim($sub['text'])) . "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!*
|
/*!*
|
||||||
|
Loading…
Reference in New Issue
Block a user