Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/Log.php')
-rw-r--r--core/Log.php25
1 files changed, 16 insertions, 9 deletions
diff --git a/core/Log.php b/core/Log.php
index 0be03c98d0..15481b315d 100644
--- a/core/Log.php
+++ b/core/Log.php
@@ -42,7 +42,7 @@ abstract class Piwik_Log extends Zend_Log
$this->fileFormatter = $fileFormatter;
$this->screenFormatter = $screenFormatter;
- $this->logToDatabaseTableName = Piwik::prefixTable($logToDatabaseTableName);
+ $this->logToDatabaseTableName = Piwik_Common::prefixTable($logToDatabaseTableName);
$this->logToDatabaseColumnMapping = $logToDatabaseColumnMapping;
}
@@ -61,7 +61,6 @@ abstract class Piwik_Log extends Zend_Log
function addWriteToNull()
{
- Zend_Loader::loadClass('Zend_Log_Writer_Null');
$this->addWriter( new Zend_Log_Writer_Null );
}
@@ -90,7 +89,7 @@ abstract class Piwik_Log extends Zend_Log
/**
* Log an event
*/
- public function log($event, $priority)
+ public function log($event, $priority, $extras = null)
{
// sanity checks
if (empty($this->_writers)) {
@@ -139,8 +138,7 @@ class Piwik_Log_Formatter_FileFormatter implements Zend_Log_Formatter_Interface
}
$ts = $event['timestamp'];
unset($event['timestamp']);
- $str = $ts . ' ' . implode(" ", $event) . "\n";
- return $str;
+ return $ts . ' ' . implode(" ", $event) . "\n";
}
}
@@ -156,11 +154,10 @@ class Piwik_Log_Formatter_ScreenFormatter implements Zend_Log_Formatter_Interfac
// no injection in error messages, backtrace when displayed on screen
return array_map('htmlspecialchars', $event);
}
-
+
function format($string)
{
- $string = self::getFormattedString($string);
- return $string;
+ return self::getFormattedString($string);
}
static public function getFormattedString($string)
@@ -168,7 +165,17 @@ class Piwik_Log_Formatter_ScreenFormatter implements Zend_Log_Formatter_Interfac
if(Piwik_Common::isPhpCliMode())
{
$string = str_replace(array('<br>','<br />','<br/>'), "\n", $string);
- $string = strip_tags($string);
+ if(is_array($string))
+ {
+ for($i=0; $i< count($string); $i++)
+ {
+ $string[$i] = strip_tags($string[$i]);
+ }
+ }
+ else
+ {
+ $string = strip_tags($string);
+ }
}
return $string;
}