Commit cfa96ccc authored by Jonny Bradley's avatar Jonny Bradley

[MRG/r76205:76211] 4 commits from xorti, luci, guill.bout, tikibot

(xorti) [ENH] Support and  test PHP 7.4
(luci) [FIX] User Mentions: notification emails were missing the path when Tiki is installed in subdirectory + url encode page names with spaces so the whole link is clickable and leads to correct page
(guill.bout) [FIX] fix redirect to undefined page in pluginbutton if data-attribute empty
(tikibot) [UPD] Update 21.x vendor_bundled dependencies
parents 22150146 10636fd7
Pipeline #138237109 passed with stages
in 11 minutes and 30 seconds
......@@ -251,6 +251,10 @@ unit-tests-72:
unit-tests-73:
<<: *template-unit-tests
image: rjsmelo/ubuntu-php:7.3-qa
unit-tests-74:
<<: *template-unit-tests
image: rjsmelo/ubuntu-php:7.4-qa
allow_failure: true
#
......
......@@ -117,7 +117,7 @@ class AuthTokens
if ($data['entry'] !== $sefurl && $full_entry_encoded !== $sefurl && $convertedSefurl !== $sefurl) {
return null; // entry doesn't match
}
} elseif ($data['entry'] != $entry) {
} elseif (! isset($data['entry']) || $data['entry'] != $entry) {
return null; // entry doesn't match
}
......
......@@ -99,8 +99,8 @@ class Email
$tikilib = \TikiLib::lib('tiki');
$smarty = \TikiLib::lib('smarty');
$machine = parse_url($_SERVER['REQUEST_URI']);
$machine = $tikilib->httpPrefix(true);
$foo = parse_url($_SERVER['REQUEST_URI']);
$machine = $tikilib->httpPrefix(true) . dirname($foo['path']);
$smarty->assign('siteName', $info['siteName']);
$smarty->assign('mentionedBy', $info['mentionedBy']);
......
......@@ -29,7 +29,7 @@ class FileGalLib extends TikiLib
if (empty($gal_info)) {
$gal_info = $this->get_file_gallery_info((int)$galleryId);
}
if (($gal_info["type"] == "podcast") || ($gal_info["type"] == "vidcast")) {
if (isset($gal_info['type']) && in_array($gal_info['type'], ['podcast', 'vidcast'])) {
return true;
} else {
return false;
......@@ -3388,9 +3388,11 @@ class FileGalLib extends TikiLib
public function fileContentIsSVG(&$data)
{
$finfo = new finfo(FILEINFO_MIME);
$type = $finfo->buffer($data) . "\n";
if (substr($type, 0, 18) == 'application/x-gzip') {
if (substr($type, 0, 18) == 'application/x-gzip' ||
substr($type, 0, 16) == 'application/gzip') {
$data = gzdecode($data);
$finfo = new finfo(FILEINFO_MIME);
$type = $finfo->buffer($data);
......
......@@ -67,7 +67,9 @@ class Reports_Send_EmailBuilderTest extends TikiTestCase
->will($this->returnValue('2011-09-12 20:30'));
$trklib = $this->createMock(get_class(TikiLib::lib('trk')));
$trklib->expects($this->once())->method('get_tracker');
$trklib->expects($this->once())
->method('get_tracker')
->will($this->returnValue(['id' => '2', 'name' => 'Test Tracker']));
$trklib->expects($this->once())
->method('get_isMain_value')
->will($this->returnValue('Tracker item name'));
......
......@@ -129,7 +129,14 @@ class TikiImporter_Wiki_Test extends TikiImporter_TestCase
->getMock();
$obj->expects($this->exactly(6))->method('insertPage')->will($this->onConsecutiveCalls(true, true, false, true, false, true));
$parsedData = [1, 2, 3, 4, 5, 6];
$parsedData = [
['name' => 'Page1'],
['name' => 'Page2'],
['name' => 'Page3'],
['name' => 'Page4'],
['name' => 'Page5'],
['name' => 'Page6'],
];
$countData = $obj->insertData($parsedData);
$expectedResult = ['totalPages' => 6, 'importedPages' => 4];
......
......@@ -3537,7 +3537,7 @@ class UsersLib extends TikiLib
$utr['usersTrackerId'] = '';
foreach ($utr['groups'] as $gr) {
$utrid = $this->get_usertrackerid($gr);
if ($utrid['usersTrackerId'] and $utrid['usersFieldId']) {
if (! empty($utrid['usersTrackerId']) && ! empty($utrid['usersFieldId'])) {
$utrid['group'] = $gr;
$utrid['user'] = $utr['login'];
$utr = $utrid;
......
......@@ -1216,7 +1216,7 @@ class EditLib
break;
default:
$e = end($p['stack']);
if ($node['data']['name'] == $e['tag']) {
if (isset($e['tag']) && $node['data']['name'] == $e['tag']) {
$src .= $e['string'];
array_pop($p['stack']);
}
......
......@@ -1334,7 +1334,7 @@ if (isset($_REQUEST["save"])
$emailData = [
'siteName' => TikiLib::lib('tiki')->get_preference('browsertitle'),
'mentionedBy' => $mentionedBy['login'],
'section' => $info_new['pageName'] . '#mentioned-' . $user . '-section-' . $count
'section' => urlencode($info_new['pageName']) . '#mentioned-' . $user . '-section-' . $count
];
Tiki\Notifications\Email::sendMentionNotification('mention_notification_subject.tpl', 'mention_notification.tpl', $emailData, [$userInfo]);
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment