Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Join echos

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@642 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
commit ff85f12518710a940a654ffab101585260480211 1 parent eebf5dc
jakubvrana authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 _compile.php
View
12 _compile.php
@@ -110,7 +110,8 @@ function php_shrink($input) {
$set = array_flip(preg_split('//', '!"#$&\'()*+,-./:;<=>?@[\]^`{|}'));
$space = '';
$output = '';
- foreach ($tokens as $i => $token) {
+ $in_echo = false;
+ for (reset($tokens); list($i, $token) = each($tokens); ) {
if (!is_array($token)) {
$token = array(0, $token);
}
@@ -123,6 +124,15 @@ function php_shrink($input) {
if ($token[1] == ';') {
$shortening = true;
}
+ } elseif ($token[0] == T_ECHO) {
+ $in_echo = true;
+ } elseif ($token[1] == ';' && $in_echo) {
+ $in_echo = false;
+ if ($tokens[$i+1][0] === T_WHITESPACE && $tokens[$i+2][0] === T_ECHO) {
+ next($tokens);
+ next($tokens);
+ $token[1] = '.'; //! join ''.'' and "".""
+ }
} elseif ($token[0] === T_VARIABLE && !isset($special_variables[$token[1]])) {
$token[1] = '$' . $short_variables[$token[1]];
} elseif ($token[0] === T_STRING && $tokens[$i+1] === '(' && isset($defined_functions[$token[1]])
Please sign in to comment.
Something went wrong with that request. Please try again.