1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-09 00:06:55 +02:00

Adjustment to reduce changes to fix just issues from standard API log usage

This commit is contained in:
Ryan Cramer
2016-10-13 10:44:17 -04:00
parent 596acaa44b
commit 8896f25d14

View File

@@ -303,16 +303,19 @@ class WireLog extends Wire {
if(count($parts) == 2) { if(count($parts) == 2) {
$entry = array( $entry = array(
'date' => $parts[0], 'date' => $parts[0],
'user' => $usr = $this->wire('sanitizer')->pageNameUTF8($parts[1]) === $parts[1] ? $parts[1] : '', 'user' => '',
'url' => $url = strpos($parts[1], '://') !== false ? $parts[1] : '', 'url' => '',
'text' => $url === '' && $usr === '' && strpos($parts[1], '://') === false ? $parts[1] : '' 'text' => $parts[1]
); );
} else if(count($parts) == 3) { } else if(count($parts) == 3) {
$user = strpos($parts[1], '/') === false ? $parts[1] : '';
$url = strpos($parts[2], '://') ? $parts[2] : '';
$text = empty($url) ? $parts[2] : '';
$entry = array( $entry = array(
'date' => $parts[0], 'date' => $parts[0],
'user' => $usr = $this->wire('sanitizer')->pageNameUTF8($parts[1]) === $parts[1] ? $parts[1] : '', 'user' => $user,
'url' => $url = (strpos($parts[2], '://') !== false ? $parts[2] : (strpos($parts[1], '://') !== false ? $parts[1] : '')), 'url' => $url,
'text' => $url === '' || $usr === '' ? $parts[2] : '' 'text' => $text
); );
} else { } else {
$entry = array( $entry = array(