Fix public client IP extraction and hide duplicate footer creation date
- Enhance RequestLogger::getClientIp() with 2-pass detection prioritizing public IPs over proxy/internal IPs - Hide footer creation date when identical to modification date to prevent duplicate date display - Improve AdminAuth log helper and footer template tooltips
This commit is contained in:
@@ -478,9 +478,13 @@ class CodePressCMS {
|
||||
$created = date('d-m-Y H:i', $createdTimestamp);
|
||||
}
|
||||
|
||||
// Show created date only if it is distinctly different from modified date
|
||||
$showCreated = ($created !== $modified);
|
||||
|
||||
return [
|
||||
'created' => $created,
|
||||
'modified' => $modified,
|
||||
'show_created' => $showCreated,
|
||||
'size' => $this->formatFileSize($stats['size'])
|
||||
];
|
||||
}
|
||||
@@ -1151,10 +1155,12 @@ class CodePressCMS {
|
||||
if (isset($page['file_info'])) {
|
||||
$templateData['created'] = htmlspecialchars($page['file_info']['created']);
|
||||
$templateData['modified'] = htmlspecialchars($page['file_info']['modified']);
|
||||
$templateData['show_created'] = !empty($page['file_info']['show_created']);
|
||||
$templateData['file_info_block'] = true;
|
||||
} else {
|
||||
$templateData['created'] = '';
|
||||
$templateData['modified'] = '';
|
||||
$templateData['show_created'] = false;
|
||||
$templateData['file_info_block'] = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user