mirror of
https://github.com/vrana/adminer.git
synced 2026-04-11 15:08:29 +02:00
php_shrink: Move add_apo_slashes to compile.php
This commit is contained in:
@@ -55,10 +55,10 @@ function php_shrink($input) {
|
||||
foreach ($tokens as $i => $token) {
|
||||
if (
|
||||
$tokens[$i+2][0] === T_CLOSE_TAG && $tokens[$i+3][0] === T_INLINE_HTML && $tokens[$i+4][0] === T_OPEN_TAG
|
||||
&& strlen(add_apo_slashes($tokens[$i+3][1])) < strlen($tokens[$i+3][1]) + 3
|
||||
&& strlen(addcslashes($tokens[$i+3][1], "\\'")) < strlen($tokens[$i+3][1]) + 3
|
||||
) {
|
||||
$tokens[$i+2] = array(T_ECHO, 'echo');
|
||||
$tokens[$i+3] = array(T_CONSTANT_ENCAPSED_STRING, "'" . add_apo_slashes($tokens[$i+3][1]) . "'");
|
||||
$tokens[$i+3] = array(T_CONSTANT_ENCAPSED_STRING, "'" . addcslashes($tokens[$i+3][1], "\\'") . "'");
|
||||
$tokens[$i+4] = array(0, ';');
|
||||
}
|
||||
}
|
||||
@@ -140,7 +140,3 @@ function short_identifier($number, $chars) {
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function add_apo_slashes($s) {
|
||||
return addcslashes($s, "\\'");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user