!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.2.22 (Debian). PHP/5.6.36 

uname -a: Linux h05.hvosting.ua 4.9.110-amd64 #3 SMP Sun Nov 4 16:27:09 UTC 2018 x86_64 

uid=1389(h33678) gid=1099(h33678) groups=1099(h33678),502(mgrsecure) 

Safe-mode: OFF (not secure)

/home/h33678/data/www/inet-tech.org.ua/smarty/plugins/   drwxr-xr-x
Free 116.99 GB of 200.55 GB (58.33%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     function.math.php (2.83 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * Smarty plugin
 *
 * This plugin is only for Smarty2 BC
 * @package Smarty
 * @subpackage PluginsFunction
 */

/**
 * Smarty {math} function plugin
 *
 * Type:     function<br>
 * Name:     math<br>
 * Purpose:  handle math computations in template
 *
 * @link http://www.smarty.net/manual/en/language.function.math.php {math}
 *          (Smarty online manual)
 * @author   Monte Ohrt <monte at ohrt dot com>
 * @param array                    $params   parameters
 * @param Smarty_Internal_Template $template template object
 * @return string|null
 */
function smarty_function_math($params$template)
{
    static 
$_allowed_funcs = array(
        
'int' => true'abs' => true'ceil' => true'cos' => true'exp' => true'floor' => true,
        
'log' => true'log10' => true'max' => true'min' => true'pi' => true'pow' => true,
        
'rand' => true'round' => true'sin' => true'sqrt' => true'srand' => true ,'tan' => true
    
);
    
// be sure equation parameter is present
    
if (empty($params['equation'])) {
        
trigger_error("math: missing equation parameter",E_USER_WARNING);
        return;
    }

    
$equation $params['equation'];

    
// make sure parenthesis are balanced
    
if (substr_count($equation,"(") != substr_count($equation,")")) {
        
trigger_error("math: unbalanced parenthesis",E_USER_WARNING);
        return;
    }

    
// match all vars in equation, make sure all are passed
    
preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]*)!",$equation$match);

    foreach(
$match[1] as $curr_var) {
        if (
$curr_var && !isset($params[$curr_var]) && !isset($_allowed_funcs[$curr_var])) {
            
trigger_error("math: function call $curr_var not allowed",E_USER_WARNING);
            return;
        }
    }

    foreach(
$params as $key => $val) {
        if (
$key != "equation" && $key != "format" && $key != "assign") {
            
// make sure value is not empty
            
if (strlen($val)==0) {
                
trigger_error("math: parameter $key is empty",E_USER_WARNING);
                return;
            }
            if (!
is_numeric($val)) {
                
trigger_error("math: parameter $key: is not numeric",E_USER_WARNING);
                return;
            }
            
$equation preg_replace("/\b$key\b/"" \$params['$key'] "$equation);
        }
    }
    
$smarty_math_result null;
    eval(
"\$smarty_math_result = ".$equation.";");

    if (empty(
$params['format'])) {
        if (empty(
$params['assign'])) {
            return 
$smarty_math_result;
        } else {
            
$template->assign($params['assign'],$smarty_math_result);
        }
    } else {
        if (empty(
$params['assign'])){
            
printf($params['format'],$smarty_math_result);
        } else {
            
$template->assign($params['assign'],sprintf($params['format'],$smarty_math_result));
        }
    }
}

?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by PinoyWH1Z | C99Shell Github | Generation time: 0.036 ]--