!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/apex_tdfonline/php/3ros/PhpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/   drwxr-xr-x
Free 13.84 GB of 61.93 GB (22.35%)
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.51 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */


/**
 * Smarty {math} function plugin
 *
 * Type:     function<br>
 * Name:     math<br>
 * Purpose:  handle math computations in template<br>
 * @link http://smarty.php.net/manual/en/language.function.math.php {math}
 *          (Smarty online manual)
 * @param array
 * @param Smarty
 * @return string
 */
function smarty_function_math($params, &$smarty)
{
    
// be sure equation parameter is present
    
if (empty($params['equation'])) {
        
$smarty->trigger_error("math: missing equation parameter");
        return;
    }

    
$equation $params['equation'];

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

    
// match all vars in equation, make sure all are passed
    
preg_match_all("!\!(0x)([a-zA-Z][a-zA-Z0-9_]*)!",$equation$match);
    
$allowed_funcs = array('int','abs','ceil','cos','exp','floor','log','log10',
                           
'max','min','pi','pow','rand','round','sin','sqrt','srand','tan');
    foreach(
$match[2] as $curr_var) {
        if (!
in_array($curr_var,array_keys($params)) && !in_array($curr_var$allowed_funcs)) {
            
$smarty->trigger_error("math: parameter $curr_var not passed as argument");
            return;
        }
    }

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

    eval(
"\$smarty_math_result = ".$equation.";");

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

/* vim: set expandtab: */

?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.9621 ]--