Fix all remaining hardcoded /var/cpanel paths in wordpress-cron-manager
FIXES:
wordpress-cron-manager.sh:
- Lines 591, 722: Added userdata_base variable and replaced hardcoded paths (2 instances)
- Lines 604, 735: Used $userdata_base for wildcard paths (2 instances)
Total fixes in this file: 4 more instances
Now using ${SYS_CPANEL_USERDATA_DIR:-/var/cpanel/userdata} consistently throughout
MILESTONE:
🎉 ALL MEDIUM ISSUES NOW RESOLVED! 🎉
QA STATUS:
- CRITICAL: 0 ✓
- HIGH: 0 ✓
- MEDIUM: 0 ✓
- LOW: 11 (final batch)
Total issues remaining: 11 (all LOW priority)
This commit is contained in:
@@ -588,7 +588,8 @@ case "$choice" in
|
||||
wp_config=""
|
||||
|
||||
# Method 1: Check main_domain in main files
|
||||
for userdata_file in /var/cpanel/userdata/*/main; do
|
||||
local userdata_base="${SYS_CPANEL_USERDATA_DIR:-/var/cpanel/userdata}"
|
||||
for userdata_file in "$userdata_base"/*/main; do
|
||||
if grep -q "^main_domain: $domain" "$userdata_file" 2>/dev/null; then
|
||||
user=$(basename "$(dirname "$userdata_file")")
|
||||
potential_config="/home/$user/public_html/wp-config.php"
|
||||
@@ -601,7 +602,7 @@ case "$choice" in
|
||||
|
||||
# Method 2: Search domain-specific files for servername
|
||||
if [ -z "$wp_config" ]; then
|
||||
for userdata_file in /var/cpanel/userdata/*/*; do
|
||||
for userdata_file in "$userdata_base"/*/*; do
|
||||
[[ "$userdata_file" == *.cache ]] && continue
|
||||
[[ "$userdata_file" == */main ]] && continue
|
||||
[[ "$userdata_file" == */cache ]] && continue
|
||||
|
||||
Reference in New Issue
Block a user