Compile inline HTML to echo
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@953 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
28b2b8db72
commit
c030c16322
|
@ -63,7 +63,7 @@ function page_footer($missing = false) {
|
|||
<?php switch_lang(); ?>
|
||||
<div id="menu">
|
||||
<h1><a href="http://www.adminer.org/" class="h1"><?php echo $adminer->name(); ?></a> <?php echo $VERSION; ?>
|
||||
<a href='http://www.adminer.org/#download' id="version"><?php echo (version_compare($VERSION, $_COOKIE["adminer_version"]) < 0 ? h($_COOKIE["adminer_version"]) : ""); ?></a>
|
||||
<a href="http://www.adminer.org/#download" id="version"><?php echo (version_compare($VERSION, $_COOKIE["adminer_version"]) < 0 ? h($_COOKIE["adminer_version"]) : ""); ?></a>
|
||||
</h1>
|
||||
<?php $adminer->navigation($missing); ?>
|
||||
</div>
|
||||
|
|
13
compile.php
13
compile.php
|
@ -109,6 +109,14 @@ function php_shrink($input) {
|
|||
if ($token[0] == T_DOC_COMMENT) {
|
||||
$doc_comment = true;
|
||||
}
|
||||
if ($token[0] == T_CLOSE_TAG && $tokens[$i+1][0] == T_INLINE_HTML && $tokens[$i+2][0] == T_OPEN_TAG
|
||||
&& strlen(addcslashes($tokens[$i+1][1], "'\\")) < strlen($tokens[$i+1][1]) + 4
|
||||
) {
|
||||
$tokens[$i] = array(T_ECHO, 'echo');
|
||||
$tokens[$i+1] = array(T_CONSTANT_ENCAPSED_STRING, "'" . addcslashes($tokens[$i+1][1], "'\\") . "'");
|
||||
$tokens[$i+2] = array(0, ';');
|
||||
$token = $tokens[$i];
|
||||
}
|
||||
if ($token[0] == T_VAR) {
|
||||
$shortening = false;
|
||||
} elseif (!$shortening) {
|
||||
|
@ -120,8 +128,11 @@ function php_shrink($input) {
|
|||
} elseif ($token[1] == ';' && $in_echo) {
|
||||
$in_echo = false;
|
||||
if ($tokens[$i+1][0] === T_WHITESPACE && $tokens[$i+2][0] === T_ECHO) {
|
||||
// join two consecutive echos
|
||||
next($tokens);
|
||||
$i++;
|
||||
}
|
||||
if ($tokens[$i+1][0] === T_ECHO) {
|
||||
// join two consecutive echos
|
||||
next($tokens);
|
||||
$token[1] = '.'; //! join ''.'' and "".""
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue