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
27f6df37
Commit
27f6df37
authored
Jun 09, 2008
by
Seldaek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Changed {reverse} handling of strings; fixed mb strings
git-svn-id:
svn://dwoo.org/dwoo/trunk@90
0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent
3cbed7fd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
Dwoo.php
lib/Dwoo.php
+2
-0
reverse.php
lib/plugins/builtin/functions/reverse.php
+8
-1
No files found.
lib/Dwoo.php
View file @
27f6df37
...
...
@@ -658,6 +658,8 @@ class Dwoo
/**
* returns the character set used by the string manipulation plugins
*
* the charset is automatically lowercased
*
* @return string
*/
public
function
getCharset
()
...
...
lib/plugins/builtin/functions/reverse.php
View file @
27f6df37
...
...
@@ -26,7 +26,14 @@ function Dwoo_Plugin_reverse(Dwoo $dwoo, $value, $preserve_keys=false)
{
if
(
is_array
(
$value
))
{
return
array_reverse
(
$value
,
$preserve_keys
);
}
elseif
((
$charset
=
$dwoo
->
getCharset
())
===
'iso-8859-1'
)
{
return
strrev
((
string
)
$value
);
}
else
{
return
implode
(
''
,
array_reverse
(
str_split
((
string
)
$value
,
1
)));
$strlen
=
mb_strlen
(
$value
);
$out
=
''
;
while
(
$strlen
--
)
{
$out
.=
mb_substr
(
$value
,
$strlen
,
1
,
$charset
);
}
return
$out
;
}
}
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