Skip to content

Commit 23e98ec

Browse files
Merge remote-tracking branch 'origin/testlink_1_9_20_fixed' into testlink_1_9_20_fixed
2 parents f90b6d7 + 42369dc commit 23e98ec

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

lib/functions/logger.class.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ class tlLogger extends tlObject
8484
protected $eventManager;
8585
protected $loggerTypeClass = array('db' => null, 'file' => null, 'mail' => null);
8686
protected $loggerTypeDomain;
87+
88+
protected $logLevelFilter;
89+
protected $db;
90+
8791

8892
public function __construct(&$db)
8993
{
@@ -124,9 +128,8 @@ public function getEventsFor($logLevels = null,$objectIDs = null,$objectTypes =
124128
$activityCodes = null,$limit = -1,$startTime = null,
125129
$endTime = null, $users = null)
126130
{
127-
return $this->eventManager->getEventsFor($logLevels,
128-
$objectIDs,$objectTypes,$activityCodes,
129-
$limit,$startTime,$endTime,$users);
131+
return $this->eventManager->getEventsFor($logLevels,$objectIDs,$objectTypes,$activityCodes,
132+
$limit,$startTime,$endTime,$users);
130133
}
131134

132135
public function deleteEventsFor($logLevels = null,$startTime = null)
@@ -1206,12 +1209,8 @@ static public function getLogFileName()
12061209
{
12071210
global $tlCfg;
12081211
$uID = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0;
1209-
$lp = $tlCfg->log_path;
1210-
if ($uID > 0) {
1211-
return $lp . 'userlog' . $uID . ".log";
1212-
}
1213-
return $lp . 'testlinklog.log';
12141212

1213+
return $tlCfg->log_path . 'userlog' . $uID . ".log";
12151214
}
12161215

12171216
/**
@@ -1423,14 +1422,14 @@ function watchPHPErrors($errno, $errstr, $errfile, $errline)
14231422
if ($doIt && isset($errors[$errno]) )
14241423
{
14251424
// suppress some kind of errors
1426-
// strftime(),strtotime(),date()
1425+
// @strftime(),strtotime(),date()
14271426
// work in block just to make copy and paste easier
14281427
// Block 1 - errstr
14291428
// Block 2 - errfile
14301429
//
14311430
if( ($errno == E_NOTICE && strpos($errstr,"unserialize()") !== false) ||
14321431
($errno == E_NOTICE && strpos($errstr,"ob_end_clean()") !== false) ||
1433-
($errno == E_STRICT && strpos($errstr,"strftime()") !== false) ||
1432+
($errno == E_STRICT && strpos($errstr,"@strftime()") !== false) ||
14341433
($errno == E_STRICT && strpos($errstr,"mktime()") !== false) ||
14351434
($errno == E_STRICT && strpos($errstr,"date()") !== false) ||
14361435
($errno == E_STRICT && strpos($errstr,"strtotime()") !== false) ||

lib/functions/string_api.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -288,15 +288,15 @@ function string_insert_hrefs( $p_string ) {
288288

289289
# valid set of characters that may occur in url scheme. Note: - should be first (A-F != -AF).
290290
$t_url_valid_chars = '-_.,!~*\';\/?%^\\\\:@&={\|}+$#[:alnum:]\pL';
291-
$t_url_chars = "(?:${t_url_hex}|[${t_url_valid_chars}\(\)\[\]])";
292-
$t_url_chars2 = "(?:${t_url_hex}|[${t_url_valid_chars}])";
293-
$t_url_chars_in_brackets = "(?:${t_url_hex}|[${t_url_valid_chars}\(\)])";
294-
$t_url_chars_in_parens = "(?:${t_url_hex}|[${t_url_valid_chars}\[\]])";
291+
$t_url_chars = "(?:{$t_url_hex}|[{$t_url_valid_chars}\(\)\[\]])";
292+
$t_url_chars2 = "(?:{$t_url_hex}|[{$t_url_valid_chars}])";
293+
$t_url_chars_in_brackets = "(?:{$t_url_hex}|[{$t_url_valid_chars}\(\)])";
294+
$t_url_chars_in_parens = "(?:{$t_url_hex}|[{$t_url_valid_chars}\[\]])";
295295

296-
$t_url_part1 = "${t_url_chars}";
297-
$t_url_part2 = "(?:\(${t_url_chars_in_parens}*\)|\[${t_url_chars_in_brackets}*\]|${t_url_chars2})";
296+
$t_url_part1 = "{$t_url_chars}";
297+
$t_url_part2 = "(?:\({$t_url_chars_in_parens}*\)|\[{$t_url_chars_in_brackets}*\]|{$t_url_chars2})";
298298

299-
$s_url_regex = "/(${t_url_protocol}(${t_url_part1}*?${t_url_part2}+))/su";
299+
$s_url_regex = "/({$t_url_protocol}({$t_url_part1}*?{$t_url_part2}+))/su";
300300

301301
# e-mail regex
302302
$s_email_regex = substr_replace( email_regex_simple(), '(?:mailto:)?', 1, 0 );
@@ -306,7 +306,7 @@ function string_insert_hrefs( $p_string ) {
306306
/*
307307
$t_function = create_function( '$p_match', '
308308
$t_url_href = \'href="\' . rtrim( $p_match[1], \'.\' ) . \'"\';
309-
return "<a ${t_url_href}>${p_match[1]}</a> [<a ${t_url_href} target=\"_blank\">^</a>]";
309+
return "<a {$t_url_href}>{$p_match[1]}</a> [<a {$t_url_href} target=\"_blank\">^</a>]";
310310
' );
311311
$p_string = preg_replace_callback( $s_url_regex, $t_function, $p_string );
312312
if( $t_change_quotes ) {
@@ -324,7 +324,7 @@ function ( $p_match ) {
324324
} else {
325325
$t_url_target = '';
326326
}
327-
return "<a ${t_url_href}${t_url_target}>${p_match[1]}</a>";
327+
return "<a {$t_url_href}{$t_url_target}>{$p_match[1]}</a>";
328328
},
329329
$p_string
330330
);
@@ -535,9 +535,9 @@ function email_regex_simple() {
535535

536536
# a domain is one or more subdomains
537537
$t_subdomain = "(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)";
538-
$t_domain = "(${t_subdomain}(?:\.${t_subdomain})*)";
538+
$t_domain = "({$t_subdomain}(?:\.{$t_subdomain})*)";
539539

540-
$s_email_regex = "/${t_recipient}\@${t_domain}/i";
540+
$s_email_regex = "/{$t_recipient}\@{$t_domain}/i";
541541
}
542542
return $s_email_regex;
543543
}

0 commit comments

Comments
 (0)