Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
Dwoo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Common
Dwoo
Commits
3e859043
Commit
3e859043
authored
Jun 06, 2008
by
Seldaek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Fixed preg_quote() usage
git-svn-id:
svn://dwoo.org/dwoo/trunk@88
0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent
b9a093a2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
Compiler.php
lib/Dwoo/Compiler.php
+2
-2
extends.php
lib/plugins/builtin/functions/extends.php
+3
-3
pre.smarty_compat.php
lib/plugins/builtin/processors/pre.smarty_compat.php
+2
-2
No files found.
lib/Dwoo/Compiler.php
View file @
3e859043
...
@@ -221,8 +221,8 @@ class Dwoo_Compiler implements Dwoo_ICompiler
...
@@ -221,8 +221,8 @@ class Dwoo_Compiler implements Dwoo_ICompiler
{
{
$this
->
ld
=
$left
;
$this
->
ld
=
$left
;
$this
->
rd
=
$right
;
$this
->
rd
=
$right
;
$this
->
ldr
=
preg_quote
(
$left
);
$this
->
ldr
=
preg_quote
(
$left
,
'/'
);
$this
->
rdr
=
preg_quote
(
$right
);
$this
->
rdr
=
preg_quote
(
$right
,
'/'
);
}
}
/**
/**
...
...
lib/plugins/builtin/functions/extends.php
View file @
3e859043
...
@@ -31,8 +31,8 @@ class Dwoo_Plugin_extends extends Dwoo_Plugin implements Dwoo_ICompilable
...
@@ -31,8 +31,8 @@ class Dwoo_Plugin_extends extends Dwoo_Plugin implements Dwoo_ICompilable
public
static
function
compile
(
Dwoo_Compiler
$compiler
,
$file
)
public
static
function
compile
(
Dwoo_Compiler
$compiler
,
$file
)
{
{
list
(
$l
,
$r
)
=
$compiler
->
getDelimiters
();
list
(
$l
,
$r
)
=
$compiler
->
getDelimiters
();
self
::
$l
=
preg_quote
(
$l
);
self
::
$l
=
preg_quote
(
$l
,
'/'
);
self
::
$r
=
preg_quote
(
$r
);
self
::
$r
=
preg_quote
(
$r
,
'/'
);
if
(
$compiler
->
getLooseOpeningHandling
())
{
if
(
$compiler
->
getLooseOpeningHandling
())
{
self
::
$l
.=
'\s*'
;
self
::
$l
.=
'\s*'
;
...
@@ -120,7 +120,7 @@ class Dwoo_Plugin_extends extends Dwoo_Plugin implements Dwoo_ICompilable
...
@@ -120,7 +120,7 @@ class Dwoo_Plugin_extends extends Dwoo_Plugin implements Dwoo_ICompilable
protected
static
function
replaceBlock
(
array
$matches
)
protected
static
function
replaceBlock
(
array
$matches
)
{
{
if
(
preg_match
(
'/'
.
self
::
$l
.
'block (["\']?)'
.
preg_quote
(
$matches
[
2
])
.
'\1'
.
self
::
$r
.
'(?:\r?\n?)(.*?)(?:\r?\n?)'
.
self
::
$l
.
'\/block'
.
self
::
$r
.
'/is'
,
self
::
$childSource
,
$override
))
{
if
(
preg_match
(
'/'
.
self
::
$l
.
'block (["\']?)'
.
preg_quote
(
$matches
[
2
]
,
'/'
)
.
'\1'
.
self
::
$r
.
'(?:\r?\n?)(.*?)(?:\r?\n?)'
.
self
::
$l
.
'\/block'
.
self
::
$r
.
'/is'
,
self
::
$childSource
,
$override
))
{
$l
=
stripslashes
(
self
::
$l
);
$l
=
stripslashes
(
self
::
$l
);
$r
=
stripslashes
(
self
::
$r
);
$r
=
stripslashes
(
self
::
$r
);
...
...
lib/plugins/builtin/processors/pre.smarty_compat.php
View file @
3e859043
...
@@ -26,8 +26,8 @@ class Dwoo_Processor_smarty_compat extends Dwoo_Processor
...
@@ -26,8 +26,8 @@ class Dwoo_Processor_smarty_compat extends Dwoo_Processor
{
{
list
(
$l
,
$r
)
=
$this
->
compiler
->
getDelimiters
();
list
(
$l
,
$r
)
=
$this
->
compiler
->
getDelimiters
();
$rl
=
preg_quote
(
$l
);
$rl
=
preg_quote
(
$l
,
'/'
);
$rr
=
preg_quote
(
$r
);
$rr
=
preg_quote
(
$r
,
'/'
);
$sectionParam
=
'(?:(name|loop|start|step|max|show)\s*=\s*(\S+))?\s*'
;
$sectionParam
=
'(?:(name|loop|start|step|max|show)\s*=\s*(\S+))?\s*'
;
$input
=
preg_replace_callback
(
'/'
.
$rl
.
'\s*section '
.
str_repeat
(
$sectionParam
,
6
)
.
'\s*'
.
$rr
.
'(.+?)(?:'
.
$rl
.
'\s*sectionelse\s*'
.
$rr
.
'(.+?))?'
.
$rl
.
'\s*\/section\s*'
.
$rr
.
'/is'
,
array
(
$this
,
'convertSection'
),
$input
);
$input
=
preg_replace_callback
(
'/'
.
$rl
.
'\s*section '
.
str_repeat
(
$sectionParam
,
6
)
.
'\s*'
.
$rr
.
'(.+?)(?:'
.
$rl
.
'\s*sectionelse\s*'
.
$rr
.
'(.+?))?'
.
$rl
.
'\s*\/section\s*'
.
$rr
.
'/is'
,
array
(
$this
,
'convertSection'
),
$input
);
$input
=
str_replace
(
'$smarty.section.'
,
'$smarty.for.'
,
$input
);
$input
=
str_replace
(
'$smarty.section.'
,
'$smarty.for.'
,
$input
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment