Linux premium180.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
LiteSpeed
: 162.0.209.168 | : 216.73.216.187
Cant Read [ /etc/named.conf ]
8.3.30
nortrmdp
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
var /
softaculous /
sitepad /
editor /
site-inc /
[ HOME SHELL ]
Name
Size
Permission
Action
ID3
[ DIR ]
drwxr-xr-x
IXR
[ DIR ]
drwxr-xr-x
PHPMailer
[ DIR ]
drwxr-xr-x
Requests
[ DIR ]
drwxr-xr-x
SimplePie
[ DIR ]
drwxr-xr-x
Text
[ DIR ]
drwxr-xr-x
certificates
[ DIR ]
drwxr-xr-x
css
[ DIR ]
drwxr-xr-x
customize
[ DIR ]
drwxr-xr-x
images
[ DIR ]
drwxr-xr-x
js
[ DIR ]
drwxr-xr-x
pomo
[ DIR ]
drwxr-xr-x
random_compat
[ DIR ]
drwxr-xr-x
rest-api
[ DIR ]
drwxr-xr-x
theme-compat
[ DIR ]
drwxr-xr-x
widgets
[ DIR ]
drwxr-xr-x
admin-bar.php
29.03
KB
-rw-r--r--
atomlib.php
11.56
KB
-rw-r--r--
author-template.php
16.22
KB
-rw-r--r--
blocks.php
12.43
KB
-rw-r--r--
bookmark-template.php
11.64
KB
-rw-r--r--
bookmark.php
13.55
KB
-rw-r--r--
bootstrap.php
4.11
KB
-rw-r--r--
cache.php
21.35
KB
-rw-r--r--
canonical.php
27.83
KB
-rw-r--r--
capabilities.php
28.84
KB
-rw-r--r--
category-template.php
50.8
KB
-rw-r--r--
category.php
12.41
KB
-rw-r--r--
class-IXR.php
2.51
KB
-rw-r--r--
class-feed.php
523
B
-rw-r--r--
class-http.php
36.22
KB
-rw-r--r--
class-json.php
39.53
KB
-rw-r--r--
class-oembed.php
30.73
KB
-rw-r--r--
class-phpass.php
7.15
KB
-rw-r--r--
class-phpmailer.php
668
B
-rw-r--r--
class-pop3.php
20.43
KB
-rw-r--r--
class-requests.php
29.09
KB
-rw-r--r--
class-simplepie.php
87.17
KB
-rw-r--r--
class-smtp.php
461
B
-rw-r--r--
class-walker-category-dropdown...
2.07
KB
-rw-r--r--
class-walker-category.php
6.62
KB
-rw-r--r--
class-walker-comment.php
13.33
KB
-rw-r--r--
class-walker-nav-menu.php
8.38
KB
-rw-r--r--
class-walker-page-dropdown.php
2.24
KB
-rw-r--r--
class-walker-page.php
6.78
KB
-rw-r--r--
class-wp-admin-bar.php
16.08
KB
-rw-r--r--
class-wp-ajax-response.php
5.01
KB
-rw-r--r--
class-wp-block-parser.php
14.86
KB
-rw-r--r--
class-wp-block-type-registry.p...
4.63
KB
-rw-r--r--
class-wp-block-type.php
4.7
KB
-rw-r--r--
class-wp-comment-query.php
42.21
KB
-rw-r--r--
class-wp-comment.php
8.75
KB
-rw-r--r--
class-wp-customize-control.php
24.49
KB
-rw-r--r--
class-wp-customize-manager.php
195.47
KB
-rw-r--r--
class-wp-customize-nav-menus.p...
53.08
KB
-rw-r--r--
class-wp-customize-panel.php
9.42
KB
-rw-r--r--
class-wp-customize-section.php
9.99
KB
-rw-r--r--
class-wp-customize-setting.php
27.59
KB
-rw-r--r--
class-wp-dependency.php
2.28
KB
-rw-r--r--
class-wp-editor.php
66.27
KB
-rw-r--r--
class-wp-embed.php
14.38
KB
-rw-r--r--
class-wp-error.php
4.81
KB
-rw-r--r--
class-wp-feed-cache-transient....
2.5
KB
-rw-r--r--
class-wp-feed-cache.php
749
B
-rw-r--r--
class-wp-hook.php
13.77
KB
-rw-r--r--
class-wp-http-cookie.php
6.44
KB
-rw-r--r--
class-wp-http-curl.php
11.64
KB
-rw-r--r--
class-wp-http-encoding.php
6.35
KB
-rw-r--r--
class-wp-http-ixr-client.php
3.25
KB
-rw-r--r--
class-wp-http-proxy.php
5.92
KB
-rw-r--r--
class-wp-http-requests-hooks.p...
1.83
KB
-rw-r--r--
class-wp-http-requests-respons...
4.19
KB
-rw-r--r--
class-wp-http-response.php
2.8
KB
-rw-r--r--
class-wp-http-streams.php
15.02
KB
-rw-r--r--
class-wp-image-editor-gd.php
13.18
KB
-rw-r--r--
class-wp-image-editor-imagick....
21.27
KB
-rw-r--r--
class-wp-image-editor.php
11.49
KB
-rw-r--r--
class-wp-list-util.php
6.25
KB
-rw-r--r--
class-wp-locale-switcher.php
4.91
KB
-rw-r--r--
class-wp-locale.php
14.26
KB
-rw-r--r--
class-wp-matchesmapregex.php
1.76
KB
-rw-r--r--
class-wp-meta-query.php
22.86
KB
-rw-r--r--
class-wp-metadata-lazyloader.p...
5.26
KB
-rw-r--r--
class-wp-network-query.php
16.79
KB
-rw-r--r--
class-wp-network.php
11.93
KB
-rw-r--r--
class-wp-oembed-controller.php
5.88
KB
-rw-r--r--
class-wp-post-type.php
17.81
KB
-rw-r--r--
class-wp-post.php
6.28
KB
-rw-r--r--
class-wp-query.php
127.67
KB
-rw-r--r--
class-wp-rewrite.php
58.42
KB
-rw-r--r--
class-wp-role.php
2.6
KB
-rw-r--r--
class-wp-roles.php
8.13
KB
-rw-r--r--
class-wp-session-tokens.php
7.25
KB
-rw-r--r--
class-wp-simplepie-file.php
2.27
KB
-rw-r--r--
class-wp-simplepie-sanitize-ks...
1.73
KB
-rw-r--r--
class-wp-site-query.php
26.78
KB
-rw-r--r--
class-wp-site.php
7.13
KB
-rw-r--r--
class-wp-tax-query.php
18.81
KB
-rw-r--r--
class-wp-taxonomy.php
10.41
KB
-rw-r--r--
class-wp-term-query.php
33.84
KB
-rw-r--r--
class-wp-term.php
5.14
KB
-rw-r--r--
class-wp-text-diff-renderer-in...
716
B
-rw-r--r--
class-wp-text-diff-renderer-ta...
16.06
KB
-rw-r--r--
class-wp-theme.php
48.09
KB
-rw-r--r--
class-wp-user-meta-session-tok...
2.92
KB
-rw-r--r--
class-wp-user-query.php
30.49
KB
-rw-r--r--
class-wp-user.php
20.91
KB
-rw-r--r--
class-wp-walker.php
12.39
KB
-rw-r--r--
class-wp-widget-factory.php
3.69
KB
-rw-r--r--
class-wp-widget.php
17.41
KB
-rw-r--r--
class-wp-xmlrpc-server.php
202.08
KB
-rw-r--r--
class-wp.php
24.18
KB
-rw-r--r--
class.wp-dependencies.php
11.24
KB
-rw-r--r--
class.wp-scripts.php
17.4
KB
-rw-r--r--
class.wp-styles.php
9.61
KB
-rw-r--r--
comment-template.php
87.64
KB
-rw-r--r--
comment.php
111.72
KB
-rw-r--r--
compat.php
15.99
KB
-rw-r--r--
cron.php
30.82
KB
-rw-r--r--
date.php
34.34
KB
-rw-r--r--
default-constants.php
9.61
KB
-rw-r--r--
default-filters.php
24.76
KB
-rw-r--r--
default-widgets.php
2.13
KB
-rw-r--r--
embed.php
44.04
KB
-rw-r--r--
feed-atom-comments.php
5.33
KB
-rw-r--r--
feed-atom.php
3.09
KB
-rw-r--r--
feed-rdf.php
2.67
KB
-rw-r--r--
feed-rss.php
1.25
KB
-rw-r--r--
feed-rss2-comments.php
4.09
KB
-rw-r--r--
feed-rss2.php
3.77
KB
-rw-r--r--
feed.php
19.29
KB
-rw-r--r--
formatting.php
280.29
KB
-rw-r--r--
functions.php
210.22
KB
-rw-r--r--
functions.wp-scripts.php
12.53
KB
-rw-r--r--
functions.wp-styles.php
8.03
KB
-rw-r--r--
general-template.php
138.46
KB
-rw-r--r--
http.php
21.9
KB
-rw-r--r--
kses.php
57.23
KB
-rw-r--r--
l10n.php
50.67
KB
-rw-r--r--
link-template.php
135.4
KB
-rw-r--r--
load.php
36.4
KB
-rw-r--r--
media-template.php
46.33
KB
-rw-r--r--
media.php
141.33
KB
-rw-r--r--
meta.php
44.98
KB
-rw-r--r--
mime.php
39.54
KB
-rw-r--r--
nav-menu-template.php
21.2
KB
-rw-r--r--
nav-menu.php
39.57
KB
-rw-r--r--
open_basedir.php
21
B
-rw-r--r--
option.php
67.91
KB
-rw-r--r--
pluggable.php
97.52
KB
-rw-r--r--
plugin.php
31.37
KB
-rw-r--r--
post-formats.php
6.86
KB
-rw-r--r--
post-template.php
60.22
KB
-rw-r--r--
post-thumbnail-template.php
8.75
KB
-rw-r--r--
post.php
227.37
KB
-rw-r--r--
query.php
31.24
KB
-rw-r--r--
rest-api.php
40.67
KB
-rw-r--r--
revision.php
21.08
KB
-rw-r--r--
rewrite.php
17.27
KB
-rw-r--r--
robots-template.php
5.06
KB
-rw-r--r--
rss.php
22.66
KB
-rw-r--r--
script-loader.php
98.75
KB
-rw-r--r--
shortcodes.php
20.25
KB
-rw-r--r--
sitepad_functions.php
19.73
KB
-rw-r--r--
sitepad_functions2.php
21.99
KB
-rw-r--r--
spl-autoload-compat.php
2.51
KB
-rw-r--r--
taxonomy.php
152.95
KB
-rw-r--r--
template-loader.php
2.55
KB
-rw-r--r--
template.php
19.77
KB
-rw-r--r--
theme.php
99.09
KB
-rw-r--r--
update.php
24.81
KB
-rw-r--r--
user.php
120.69
KB
-rw-r--r--
vars.php
5.59
KB
-rw-r--r--
version.php
2.03
KB
-rw-r--r--
widgets.php
55.82
KB
-rw-r--r--
wlwmanifest.xml
1.03
KB
-rw-r--r--
wp-db.php
99.29
KB
-rw-r--r--
wp-diff.php
662
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : sitepad_functions2.php
<?php /** * Part of sitemush DB changing * This is just below $wpdb connection * By Default we connect to sitemush DB to verify session */ // We need the ABSPATH if (!defined('ABSPATH')) exit; global $sitepad, $globals, $l, $SESS; function cleanpath($path){ $path = str_replace('\\\\', '/', $path); $path = str_replace('\\', '/', $path); $path = str_replace('//', '/', $path); return rtrim($path, '/'); } function r_print($array){ echo '<pre>'; print_r($array); echo '</pre>'; } // Generate a random string function generateRandStr($length = 10){ $characters = '0123456789abcdefghijklmnopqrstuvwxyz'; $charactersLength = strlen($characters); $randomString = ''; for($i = 0; $i < $length; $i++){ $randomString .= $characters[rand(0, $charactersLength - 1)]; } return $randomString; } // Connect to the database function soft_mysql_connect($host, $user, $pass, $newlink = false){ // Error handling for php8.1 try{ if(extension_loaded('mysqli')){ //echo 'mysqli'; $sconn = @mysqli_connect($host, $user, $pass); }else{ //echo 'mysql'; $sconn = @mysql_connect($host, $user, $pass, $newlink); } }catch(Exception $e){ return false; } return $sconn; } // Select the DB function soft_mysql_select_db($db, $conn){ // Error handling for php8.1 try{ if(extension_loaded('mysqli')){ $return = @mysqli_select_db($conn, $db); }else{ $return = @mysql_select_db($db, $conn); } }catch(Exception $e){ return false; } return $return; } // Verifies an email function emailvalidation($email){ if(!preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\+._-])*@([a-zA-Z0-9_-])+([.])+([a-zA-Z0-9\._-]+)+$/", $email)){ return false; }else{ return true; } } function _unserialize($str){ $var = @unserialize($str); if(empty($var)){ $str = preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $str); $var = @unserialize($str); } //If it is still empty false if(empty($var)){ return false; }else{ return $var; } } // Presently takes care of Slashes function inputsec($string){ //get_magic_quotes_gpc is depricated in php 7.4 if(version_compare(PHP_VERSION, '7.4', '<')){ if(!get_magic_quotes_gpc()){ $string = addslashes($string); }else{ $string = stripslashes($string); $string = addslashes($string); } }else{ $string = addslashes($string); } // This is to replace ` which can cause the command to be executed in exec() $string = str_replace('`', '\`', $string); return $string; } // Takes care of characters function htmlizer($string){ global $globals; $charset = !empty($globals['charset']) ? $globals['charset'] : null; $string = htmlentities($string, ENT_QUOTES | ENT_IGNORE, $charset); //$string = preg_replace('/(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)/e', 'entity_check(\\2);', $string); return $string; } ///////////////////// // POSTING Functions ///////////////////// function POST($name, $e, $isset = 1){ global $error; //Check the POSTED NAME was posted if(($isset && (!isset($_POST[$name]) || strlen(trim($_POST[$name])) < 1)) || (empty($isset) && empty($_POST[$name]))){ $error[$name] = $e; }else{ return inputsec(htmlizer(trim($_POST[$name]))); } } // No htmlizer post - Dont use in SQL Queries function iPOST($name, $e, $isset = 1){ global $error; //Check the POSTED NAME was posted if(($isset && (!isset($_POST[$name]) || strlen(trim($_POST[$name])) < 1)) || (empty($isset) && empty($_POST[$name]))){ $error[$name] = $e; }else{ return inputsec(trim($_POST[$name])); } } //OPTIONAL Post function optPOST($name, $default = ''){ global $error; //Check the POSTED NAME was posted if(isset($_POST[$name])){ return inputsec(htmlizer(trim($_POST[$name]))); }else{ return $default; } } /** * Return the value of the POSTED key i.e. $_POST[$key]. Is mainly used for Themes to fill the forms again automatically. * * @package forms * @subpackage post * @author Pulkit Gupta * @param string $name The key of the $_POST array i.e. the name of the input / textarea / select text * @param string $default (Optional) Default value when the POST is empty * @return string The value of the POSTED Key or the $default value when the POST is empty * @since 1.0 */ function POSTval($name, $default = ''){ return (!empty($_POST) ? (empty($_POST[$name]) ? '' : inputsec(htmlizer(trim($_POST[$name])))) : $default); } /** * Return the value of the POSTED key i.e. $_POST[$key]. Is mainly used for Themes to fill the forms again automatically. * The difference betweern aPOSTval() and POSTval() is that aPOSTval() just trims the value while POSTval will do * inputsec(htmlizer(trim($_POST[$name])))) * * @package forms * @subpackage post * @author Pulkit Gupta * @param string $name The key of the $_POST array i.e. the name of the input / textarea / select text * @param string $default (Optional) Default value when the POST is empty * @return string The value of the POSTED Key or the $default value when the POST is empty * @since 1.0 */ function aPOSTval($name, $default = ''){ return (!empty($_POST) ? (empty($_POST[$name]) ? '' : trim($_POST[$name])) : $default); } //OPTIONAL REQUEST function optREQ($name, $default = ''){ global $error; //Check the POSTED NAME was posted if(isset($_REQUEST[$name])){ return inputsec(htmlizer(trim($_REQUEST[$name]))); }else{ return $default; } } // Clean FOR var directly function optInput($val){ global $error; return inputsec(htmlizer(trim($val))); } //Check if isset in REQUEST Array else return error lang function REQUEST($name, $e){ global $error; //Check the REQUEST NAME was sent if(!isset($_REQUEST[$name]) || strlen(trim($_REQUEST[$name])) < 1){ $error[$name] = $e; }else{ return inputsec(htmlizer(trim($_REQUEST[$name]))); } } //Checkbox function checkbox($name){ global $error; //Check the Checkbox posted if(isset($_POST[$name])){ return true; }else{ return false; } } function GET($name, $e){ global $error; //Check the POSTED NAME was posted if(!isset($_GET[$name]) || strlen(trim($_GET[$name])) < 1){ $error[$name] = $e; }else{ return inputsec(htmlizer(trim($_GET[$name]))); } } //OPTIONAL GET function optGET($name, $default = ''){ global $error; //Check the GETED NAME was GETed if(isset($_GET[$name])){ return inputsec(htmlizer(trim($_GET[$name]))); }else{ return $default; } } // Strips slashes if GPC was on function rawGPC($v){ //get_magic_quotes_gpc is depricated in php 7.4 if(version_compare(PHP_VERSION, '7.4', '<')){ if(get_magic_quotes_gpc()){ $v = stripslashes($v); } } return $v; } // Make a curl call function curl_call($url, $post = array()){ // Set the curl parameters. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); // Connection Time OUT curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, (!empty($GLOBALS['globals']['curl_timeout']) ? $GLOBALS['globals']['curl_timeout'] : 10)); // You can timeout in one hour max curl_setopt($ch, CURLOPT_TIMEOUT, 3600); // Turn off the server and peer verification (TrustManager Concept). curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); // UserAgent and Cookies curl_setopt($ch, CURLOPT_USERAGENT, 'Softaculous'); if(!empty($post)){ curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); } curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Get response from the server. $resp = curl_exec($ch); $curl_err = curl_error($ch); $meta = curl_getinfo($ch); curl_close($ch); if($meta['http_code'] == 405){ return curl_call($url); } if(empty($resp)){ return false; } return $resp; } /** * phpMyAdmin SPLIT SQL function which splits the SQL data into seperate chunks that can be passed as QUERIES. * * @package database * @author Pulkit Gupta * @param string $data The SQL RAW data * @returns array The chunks of SQL Queries * @since 1.0 */ function sqlsplit($data){ $ret = array(); $buffer = ''; // Defaults for parser $sql = ''; $start_pos = 0; $i = 0; $len= 0; $big_value = 200000000; $sql_delimiter = ';'; $finished = false; while (!($finished && $i >= $len)) { if ($data === FALSE) { // subtract data we didn't handle yet and stop processing //$offset -= strlen($buffer); break; } elseif ($data === TRUE) { // Handle rest of buffer } else { // Append new data to buffer $buffer .= $data; // free memory $data = false; // Do not parse string when we're not at the end and don't have ; inside if ((strpos($buffer, $sql_delimiter, $i) === FALSE) && !$finished) { continue; } } // Current length of our buffer $len = strlen($buffer); // Grab some SQL queries out of it while ($i < $len) { $found_delimiter = false; // Find first interesting character $old_i = $i; // this is about 7 times faster that looking for each sequence i // one by one with strpos() if (preg_match('/(\'|"|#|-- |\/\*|`|(?i)DELIMITER)/', $buffer, $matches, PREG_OFFSET_CAPTURE, $i)) { // in $matches, index 0 contains the match for the complete // expression but we don't use it $first_position = $matches[1][1]; } else { $first_position = $big_value; } /** * @todo we should not look for a delimiter that might be * inside quotes (or even double-quotes) */ // the cost of doing this one with preg_match() would be too high $first_sql_delimiter = strpos($buffer, $sql_delimiter, $i); if ($first_sql_delimiter === FALSE) { $first_sql_delimiter = $big_value; } else { $found_delimiter = true; } // set $i to the position of the first quote, comment.start or delimiter found $i = min($first_position, $first_sql_delimiter); if ($i == $big_value) { // none of the above was found in the string $i = $old_i; if (!$finished) { break; } // at the end there might be some whitespace... if (trim($buffer) == '') { $buffer = ''; $len = 0; break; } // We hit end of query, go there! $i = strlen($buffer) - 1; } // Grab current character $ch = $buffer[$i]; // Quotes if (strpos('\'"`', $ch) !== FALSE) { $quote = $ch; $endq = FALSE; while (!$endq) { // Find next quote $pos = strpos($buffer, $quote, $i + 1); // No quote? Too short string if ($pos === FALSE) { // We hit end of string => unclosed quote, but we handle it as end of query if ($finished) { $endq = TRUE; $i = $len - 1; } $found_delimiter = false; break; } // Was not the quote escaped? $j = $pos - 1; while ($buffer[$j] == '\\') $j--; // Even count means it was not escaped $endq = (((($pos - 1) - $j) % 2) == 0); // Skip the string $i = $pos; if ($first_sql_delimiter < $pos) { $found_delimiter = false; } } if (!$endq) { break; } $i++; // Aren't we at the end? if ($finished && $i == $len) { $i--; } else { continue; } } // Not enough data to decide if ((($i == ($len - 1) && ($ch == '-' || $ch == '/')) || ($i == ($len - 2) && (($ch == '-' && $buffer[$i + 1] == '-') || ($ch == '/' && $buffer[$i + 1] == '*')))) && !$finished) { break; } // Comments if ($ch == '#' || ($i < ($len - 1) && $ch == '-' && $buffer[$i + 1] == '-' && (($i < ($len - 2) && $buffer[$i + 2] <= ' ') || ($i == ($len - 1) && $finished))) || ($i < ($len - 1) && $ch == '/' && $buffer[$i + 1] == '*') ) { // Copy current string to SQL if ($start_pos != $i) { $sql .= substr($buffer, $start_pos, $i - $start_pos); } // Skip the rest $j = $i; $i = strpos($buffer, $ch == '/' ? '*/' : "\n", $i); // didn't we hit end of string? if ($i === FALSE) { if ($finished) { $i = $len - 1; } else { break; } } // Skip * if ($ch == '/') { // Check for MySQL conditional comments and include them as-is if ($buffer[$j + 2] == '!') { $comment = substr($buffer, $j + 3, $i - $j - 3); if (preg_match('/^[0-9]{5}/', $comment, $version)) { if ($version[0] <= 50000000) { $sql .= substr($comment, 5); } } else { $sql .= $comment; } } $i++; } // Skip last char $i++; // Next query part will start here $start_pos = $i; // Aren't we at the end? if ($i == $len) { $i--; } else { continue; } } // Change delimiter, if redefined, and skip it (don't send to server!) if (strtoupper(substr($buffer, $i, 9)) == "DELIMITER" && ($buffer[$i + 9] <= ' ') && ($i < $len - 11) && strpos($buffer, "\n", $i + 11) !== FALSE) { $new_line_pos = strpos($buffer, "\n", $i + 10); $sql_delimiter = substr($buffer, $i + 10, $new_line_pos - $i - 10); $i = $new_line_pos + 1; // Next query part will start here $start_pos = $i; continue; } // End of SQL if ($found_delimiter || ($finished && ($i == $len - 1))) { $tmp_sql = $sql; if ($start_pos < $len) { $length_to_grab = $i - $start_pos; if (! $found_delimiter) { $length_to_grab++; } $tmp_sql .= substr($buffer, $start_pos, $length_to_grab); unset($length_to_grab); } // Do not try to execute empty SQL if (! preg_match('/^([\s]*;)*$/', trim($tmp_sql))) { $sql = $tmp_sql; $ret[] = $sql; $buffer = substr($buffer, $i + strlen($sql_delimiter)); // Reset parser: $len = strlen($buffer); $sql = ''; $i = 0; $start_pos = 0; // Any chance we will get a complete query? //if ((strpos($buffer, ';') === FALSE) && !$finished) { if ((strpos($buffer, $sql_delimiter) === FALSE) && !$finished) { break; } } else { $i++; $start_pos = $i; } } } // End of parser loop } // End of import loop return $ret; } function resetfilelist(){ global $directorylist; $directorylist = array(); } function rmdir_recursive_fn($path){ //if(!is_safe_file($path)) return false; $path = (substr($path, -1) == '/' || substr($path, -1) == '\\' ? $path : $path.'/'); resetfilelist(); $files = filelist_fn($path, 1, 0, 'all'); $files = (!is_array($files) ? array() : $files); //First delete the files only foreach($files as $k => $v){ //if(is_safe_file($k)){ // Security Fix @chmod($k, 0777); //} if(file_exists($k) && is_file($k) && @filetype($k) == "file"){ @unlink($k); } } @clearstatcache(); $folders = filelist_fn($path, 1, 1, 'all'); $folders = (!is_array($folders) ? array() : $folders); @krsort($folders); //Now Delete the FOLDERS foreach($folders as $k => $v){ //if(is_safe_file($k)){ // Security Fix @chmod($k, 0777); //} if(is_dir($k)){ @rmdir($k); } } @rmdir($path); @clearstatcache(); } function filelist_fn($startdir="./", $searchSubdirs=1, $directoriesonly=0, $maxlevel="all", $level=1, $reset = 1) { //list the directory/file names that you want to ignore $ignoredDirectory[] = "."; $ignoredDirectory[] = ".."; $ignoredDirectory[] = "_vti_cnf"; global $directorylist; //initialize global array if(substr($startdir, -1) != '/'){ $startdir = $startdir.'/'; } if (is_dir($startdir)) { if ($dh = opendir($startdir)) { while (($file = readdir($dh)) !== false) { if (!(array_search($file,$ignoredDirectory) > -1)) { if (@filetype($startdir . $file) == "dir") { //build your directory array however you choose; //add other file details that you want. $directorylist[$startdir . $file]['level'] = $level; $directorylist[$startdir . $file]['dir'] = 1; $directorylist[$startdir . $file]['name'] = $file; $directorylist[$startdir . $file]['path'] = $startdir; if ($searchSubdirs) { if ((($maxlevel) == "all") or ($maxlevel > $level)) { filelist_fn($startdir . $file . "/", $searchSubdirs, $directoriesonly, $maxlevel, ($level + 1), 0); } } } else { if (!$directoriesonly) { // echo substr(strrchr($file, "."), 1); //if you want to include files; build your file array //however you choose; add other file details that you want. $directorylist[$startdir . $file]['level'] = $level; $directorylist[$startdir . $file]['dir'] = 0; $directorylist[$startdir . $file]['name'] = $file; $directorylist[$startdir . $file]['path'] = $startdir; } } } } closedir($dh); } } if(!empty($reset)){ $r = $directorylist; $directorylist = array(); return($r); } } /** * Get a web file but add little Softaculous information like the license key, unique, panel, is_vps, env, soft_email as * arguments to the $url given. This is mainly used to FETCH FILES from Softaculous.com and related softaculous websites. * * @package files * @author Pulkit Gupta * @param string $url The URL from which the DATA is to be fetched * @param string $path (Optional) If given the FETCHED data is saved in the file instead of having it returned * @return string The FETCHED DATA * @since 1.0 */ function get_softaculous_file($url, $return_url = 0){ global $sitepad; $license = (!empty($sitepad['license']) ? $sitepad['license']['license'] : $sitepad['server_license']['license']); if(strstr($url, '?')){ $url = $url.'&license='.$license; }else{ $url = $url.'?license='.$license; } if(!empty($return_url)){ return $url; } return curl_call($url); } /** * This function will preg_match the pattern and return the respective values in $var * @package Softaculous * @author Brijesh Kothari * @param $pattern This should be the pattern to be matched * @param $file This should have the data to search from * @param $var This will be the variable which will have the preg matched data * @param $valuenum This should be the no of regular expression to be returned in $var * @param $stripslashes 0 or 1 depending upon whether the stripslashes function is to be applied (1) or not (0) * @return string Will pass value by reference in $var * @since 4.5.4 */ function soft_preg_replace($pattern, $file, &$var, $valuenum, $stripslashes = ''){ preg_match($pattern, $file, $matches); if(empty($stripslashes)){ $var = @trim($matches[$valuenum]); }else{ $var = @stripslashes(trim($matches[$valuenum])); } } function makedate($date, $format = 'd/m/Y'){ if(empty($date)) return false; $year = substr($date, 0, 4); $month = substr($date, 4, 2); $day = substr($date, 6, 2); if($format == 'd/m/Y'){ // Check the Max DAY possible $maxday = (int) date('t', mktime(0, 0, 0, $month, 1, $year)); return ($day > $maxday ? $maxday : $day).'/'.$month.'/'.$year; } return date($format, mktime(0, 0, 0, $month, $day, $year)); } /** * Copies Recrsively a File / Folder and also maintains the PERMISSIONS and UID and GID * * @package softaculous * @subpackage settings * @author Pulkit Gupta * @param string $path The Source Path * @param string $dest The Destination Path * @return bool * @since 1.0 */ function copy_r($path, $dest, $exclude = array()){ global $__settings; foreach($exclude as $skip){ //echo 'Skip path : '.$skip.'<br />'; if(preg_match('#'.preg_quote($skip, '/').'#', $path)){ //echo 'Skipping : '.$path.'<br />'; return true; } } // Is it a Directory ? if( is_dir($path) ){ // Create the Destination Dir @mkdir($dest); $stat = stat($path); // Set the mode of the destination if(!empty($stat['mode'])){ @chmod($dest, $stat['mode']); } // Set the UID if(!empty($stat['uid'])){ @chown($dest, $stat['uid']); } // Set the GID if(!empty($stat['gid'])){ @chgrp($dest, $stat['gid']); } // Start reading the current directory $objects = scandir($path); if( sizeof($objects) > 0 ){ foreach( $objects as $file ) { if( $file == "." || $file == ".." ){ continue; } // Go on copy_r( $path.'/'.$file, $dest.'/'.$file, $exclude); } } return true; }elseif( is_file($path) ){ $ret = copy($path, $dest); $stat = stat($path); // Set the mode of the destination if(!empty($stat['mode'])){ @chmod($dest, $stat['mode']); } // Set the UID if(!empty($stat['uid'])){ @chown($dest, $stat['uid']); } // Set the GID if(!empty($stat['gid'])){ @chgrp($dest, $stat['gid']); } return $ret; }else{ return false; } } function error_handle($error, $table_width = '100%', $center = false, $return = false){ global $l; $str = ""; $table_width = preg_match('/%/is', $table_width) ? $table_width : $table_width.'px'; //on error call the form if(!empty($error)){ $str .= '<script language="javascript" type="text/javascript"><!-- // --><![CDATA[ </script>'; $str .= '<div class="alert alert-danger " style="width:'.$table_width.';'.(($center) ? 'margin:auto' : '').'"><a href="#" class="close" data-dismiss="alert">×</a><div>'; $str .= '<p style="margin-top:4px; font-size:16px;"> '.__('The following errors were found').' :</p> <ul type="square" style="margin-top:-4px;">'; foreach($error as $ek => $ev){ $str .= '<li style="font-size:13px;">'.$ev.'</li>'; } $str .= '</ul> </div></div>'; if(empty($return)){ echo $str; }else{ return $str; } } } /** * Checks if a file is symlink or hardlink * @package softaculous * @author Pulkit Gupta * @returns bool false if file is a symlink or a hardlink else true * @since 4.4.3 */ function is_safe_file($path){ // Is it a symlink ? if(is_link($path)) return false; // Is it a file and is a link ? $stat = @stat($path); if(!is_dir($path) && $stat['nlink'] > 1) return false; return true; } function mkdir_recursive($pathname, $mode){ is_dir(dirname($pathname)) || mkdir_recursive(dirname($pathname), $mode); return is_dir($pathname) || @mkdir($pathname, $mode); }
Close