------------------------------------------------------------
revno: 954
committer: Jakub Jankiewicz <[email protected]>
branch nick: aikiframework
timestamp: Thu 2011-12-08 21:13:16 +0100
message:
Fix bug #900822 - parsing parameters when calling Aiki Api function
modified:
src/libs/AikiScript.php
--
lp:aikiframework
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk
Your team Aiki Framework Developers is subscribed to branch lp:aikiframework.
To unsubscribe from this branch go to
https://code.launchpad.net/~aikiframework-devel/aikiframework/trunk/+edit-subscription
=== modified file 'src/libs/AikiScript.php'
--- src/libs/AikiScript.php 2011-12-05 16:50:11 +0000
+++ src/libs/AikiScript.php 2011-12-08 20:13:16 +0000
@@ -188,19 +188,22 @@
if ( $char == $separator ) { //last character is a separator
$result[] = $word;
$result[] = "";
+ } elseif ( $char == '"' || $char == "'" ) {
+ $result[] = $word; // fix quote in last word bug
} else {
- $result[] = $word . $char;
- }
+ $result[] = $word . $char;
+ }
$word="";
- } elseif ( ( $char == "'" && $state == 1 ) || //anotate string ends.
- ( $char == '"' && $state == 2 ) ||
- ( $char == $separator && $state == 3 ) ) {
- $state = ($state == 3 ? 0 : 4);
- $result[] = $word;
- $word = "";
+ } elseif ( ( $char == "'" && $state == 1 ) || //anotate string ends.
+ ( $char == '"' && $state == 2 ) ||
+ ( $char == $separator && $state == 3 ) ) {
+ $state = ( $state == 3 ? 0 : 4 );
+
+ $result[] = $word;
+ $word = "";
} elseif ( $char == $separator && $state == 4 ) {
//found separator when waiting
- $state = 0;
+ $state = 0;
} elseif ( $char == $separator && $state == 0 ) {
//found separator when waiting a token.
$result[] = "";
@@ -214,6 +217,8 @@
} elseif ( $state == 0 ) {
$state = 3;
$word = $char;
+ } elseif ($i == $max-1) {
+
} else {
$word .= $char;
}
_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help : https://help.launchpad.net/ListHelp