Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/testlink_1_9_20_fixed' into test…
Browse files Browse the repository at this point in the history
…link_1_9_20_fixed
  • Loading branch information
testlinkDevTeam committed Aug 17, 2024
2 parents f90b6d7 + 42369dc commit 23e98ec
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
19 changes: 9 additions & 10 deletions lib/functions/logger.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ class tlLogger extends tlObject
protected $eventManager;
protected $loggerTypeClass = array('db' => null, 'file' => null, 'mail' => null);
protected $loggerTypeDomain;

protected $logLevelFilter;
protected $db;


public function __construct(&$db)
{
Expand Down Expand Up @@ -124,9 +128,8 @@ public function getEventsFor($logLevels = null,$objectIDs = null,$objectTypes =
$activityCodes = null,$limit = -1,$startTime = null,
$endTime = null, $users = null)
{
return $this->eventManager->getEventsFor($logLevels,
$objectIDs,$objectTypes,$activityCodes,
$limit,$startTime,$endTime,$users);
return $this->eventManager->getEventsFor($logLevels,$objectIDs,$objectTypes,$activityCodes,
$limit,$startTime,$endTime,$users);
}

public function deleteEventsFor($logLevels = null,$startTime = null)
Expand Down Expand Up @@ -1206,12 +1209,8 @@ static public function getLogFileName()
{
global $tlCfg;
$uID = isset($_SESSION['userID']) ? $_SESSION['userID'] : 0;
$lp = $tlCfg->log_path;
if ($uID > 0) {
return $lp . 'userlog' . $uID . ".log";
}
return $lp . 'testlinklog.log';

return $tlCfg->log_path . 'userlog' . $uID . ".log";
}

/**
Expand Down Expand Up @@ -1423,14 +1422,14 @@ function watchPHPErrors($errno, $errstr, $errfile, $errline)
if ($doIt && isset($errors[$errno]) )
{
// suppress some kind of errors
// strftime(),strtotime(),date()
// @strftime(),strtotime(),date()
// work in block just to make copy and paste easier
// Block 1 - errstr
// Block 2 - errfile
//
if( ($errno == E_NOTICE && strpos($errstr,"unserialize()") !== false) ||
($errno == E_NOTICE && strpos($errstr,"ob_end_clean()") !== false) ||
($errno == E_STRICT && strpos($errstr,"strftime()") !== false) ||
($errno == E_STRICT && strpos($errstr,"@strftime()") !== false) ||
($errno == E_STRICT && strpos($errstr,"mktime()") !== false) ||
($errno == E_STRICT && strpos($errstr,"date()") !== false) ||
($errno == E_STRICT && strpos($errstr,"strtotime()") !== false) ||
Expand Down
22 changes: 11 additions & 11 deletions lib/functions/string_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,15 @@ function string_insert_hrefs( $p_string ) {

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

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

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

# e-mail regex
$s_email_regex = substr_replace( email_regex_simple(), '(?:mailto:)?', 1, 0 );
Expand All @@ -306,7 +306,7 @@ function string_insert_hrefs( $p_string ) {
/*
$t_function = create_function( '$p_match', '
$t_url_href = \'href="\' . rtrim( $p_match[1], \'.\' ) . \'"\';
return "<a ${t_url_href}>${p_match[1]}</a> [<a ${t_url_href} target=\"_blank\">^</a>]";
return "<a {$t_url_href}>{$p_match[1]}</a> [<a {$t_url_href} target=\"_blank\">^</a>]";
' );
$p_string = preg_replace_callback( $s_url_regex, $t_function, $p_string );
if( $t_change_quotes ) {
Expand All @@ -324,7 +324,7 @@ function ( $p_match ) {
} else {
$t_url_target = '';
}
return "<a ${t_url_href}${t_url_target}>${p_match[1]}</a>";
return "<a {$t_url_href}{$t_url_target}>{$p_match[1]}</a>";
},
$p_string
);
Expand Down Expand Up @@ -535,9 +535,9 @@ function email_regex_simple() {

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

$s_email_regex = "/${t_recipient}\@${t_domain}/i";
$s_email_regex = "/{$t_recipient}\@{$t_domain}/i";
}
return $s_email_regex;
}

0 comments on commit 23e98ec

Please sign in to comment.