Commit 8ddd7b7a authored by Jorge Sá Pereira's avatar Jorge Sá Pereira
Browse files

[ENH] Add better support for PHP8

- Unit tests now pass in PHP8 as well;
- Add gitlab-ci pipeline to check lint on changed files for PHP8 syntax compability
- Add gitlab-ci pipeline to run unit tests with PHP8
- Patch libraries to fix PHP string access with curly braces
- Increase setup.sh PHP max version to 8.0
parent 410ca6cd
Pipeline #376862534 passed with stages
in 7 minutes and 50 seconds
......@@ -116,6 +116,19 @@ phplint:
- composer
allow_failure: false
phplint80:
stage: lint
image: rjsmelo/ubuntu-php:8.0-qa
script:
- RUN_COMMAND_FILTER='\.php$'
- RUN_COMMAND="php vendor_bundled/vendor/overtrue/phplint/bin/phplint -n"
- *run_command_on_files_changed
dependencies:
- composer
needs:
- composer
allow_failure: false
smarty-lint:
stage: lint
image: ${BASE_QA_IMAGE}
......@@ -427,6 +440,11 @@ unit-tests-74:
<<: *template-unit-tests
image: rjsmelo/ubuntu-php:7.4-qa
unit-tests-80:
<<: *template-unit-tests
image: rjsmelo/ubuntu-php:8.0-qa
#
# Package this Tiki build
#
......
......@@ -3,6 +3,9 @@
"adodb/adodb-php": {
"Remove the check for ADOdb Extension": "../installer/composer-patches/adodb-php__remove-the-check-if-the-adodb-php_ext-is-enabled.patch"
},
"candy-chat/xmpp-prebind-php": {
"Removed string access with curly braces syntax in PHP8": "../installer/composer-patches/xmpp-prebind-php__php8fixes.patch"
},
"jquery/jquery-sheet": {
"Fix visibility issues": "../installer/composer-patches/jquery-sheet_fix-visibility-issues.patch"
},
......@@ -14,7 +17,8 @@
},
"pear/text_wiki_mediawiki": {
"Removed deprecated syntax in PHP7": "../installer/composer-patches/text_wiki_mediawiki__php7fixes.patch",
"Renamed method to avoid collision with func from parent class": "../installer/composer-patches/text_wiki_mediawiki__func_collision.patch"
"Renamed method to avoid collision with func from parent class": "../installer/composer-patches/text_wiki_mediawiki__func_collision.patch",
"Removed string access with curly braces syntax in PHP8": "../installer/composer-patches/text_wiki_mediawiki__php8fixes.patch"
},
"pear/xml_rpc": {
"Add support for PHP7": "../installer/composer-patches/pear_xml_rpc-php7-patch-RELEASE_1_5_5.patch"
......
diff --git a/Text/Wiki.php b/Text/Wiki.php
index 647999e..aa83d57 100644
--- a/Text/Wiki.php
+++ b/Text/Wiki.php
@@ -1037,7 +1037,7 @@ class Text_Wiki {
for ($i = 0; $i < $k; $i++) {
// the current character
- $char = $this->source{$i};
+ $char = $this->source[$i];
// are alredy in a delimited section?
if ($in_delim) {
diff --git a/Text/Wiki/Parse/BBCode/Colortext.php b/Text/Wiki/Parse/BBCode/Colortext.php
index 5840043..d107eb6 100755
--- a/Text/Wiki/Parse/BBCode/Colortext.php
+++ b/Text/Wiki/Parse/BBCode/Colortext.php
@@ -81,7 +81,7 @@ class Text_Wiki_Parse_Colortext extends Text_Wiki_Parse {
}
// needs to withdraw leading # as renderer put it in
- $color = $matches[1]{0} == '#' ? substr($matches[1], 1) : $matches[1];
+ $color = $matches[1][0] == '#' ? substr($matches[1], 1) : $matches[1];
// builds the option array
$options = array('type' => 'start', 'level' => $this->_level, 'color' => $color);
diff --git a/Text/Wiki/Parse/BBCode/Url.php b/Text/Wiki/Parse/BBCode/Url.php
index 7ae4ea8..0e19401 100644
--- a/Text/Wiki/Parse/BBCode/Url.php
+++ b/Text/Wiki/Parse/BBCode/Url.php
@@ -143,7 +143,7 @@ class Text_Wiki_Parse_Url extends Text_Wiki_Parse {
if ($matches[2] === '=') {
$type = 'descr';
} elseif ($matches[2]) {
- $pre = $matches[1]{0};
+ $pre = $matches[1][0];
}
}
$matches[2] = 'mailto:' . $matches[3];
diff --git a/Text/Wiki/Parse/Cowiki/Paragraph.php b/Text/Wiki/Parse/Cowiki/Paragraph.php
index 8a535ef..18c3acc 100644
--- a/Text/Wiki/Parse/Cowiki/Paragraph.php
+++ b/Text/Wiki/Parse/Cowiki/Paragraph.php
@@ -112,7 +112,7 @@ class Text_Wiki_Parse_Paragraph extends Text_Wiki_Parse {
$key = '';
$len = strlen($matches[0]);
for ($i = 1; $i < $len; $i++) {
- $char = $matches[0]{$i};
+ $char = $matches[0][$i];
if ($char == $delim) {
break;
} else {
diff --git a/Text/Wiki/Parse/Cowiki/Wikilink.php b/Text/Wiki/Parse/Cowiki/Wikilink.php
index d2c974f..dfcc9f3 100644
--- a/Text/Wiki/Parse/Cowiki/Wikilink.php
+++ b/Text/Wiki/Parse/Cowiki/Wikilink.php
@@ -195,7 +195,7 @@ class Text_Wiki_Parse_Wikilink extends Text_Wiki_Parse {
{
// when prefixed with !, it's explicitly not a wiki link.
// return everything as it was.
- /*if ($matches[3]{0} == '!') {
+ /*if ($matches[3][0] == '!') {
return $matches[1] . substr($matches[3], 1) . $matches[4] . $matches[7];
}*/
if (!isset($matches[4])) {
diff --git a/Text/Wiki/Parse/Creole/Paragraph.php b/Text/Wiki/Parse/Creole/Paragraph.php
index c286396..ad64516 100644
--- a/Text/Wiki/Parse/Creole/Paragraph.php
+++ b/Text/Wiki/Parse/Creole/Paragraph.php
@@ -105,7 +105,7 @@ class Text_Wiki_Parse_Paragraph extends Text_Wiki_Parse {
$key = '';
$len = strlen($matches[0]);
for ($i = 1; $i < $len; $i++) {
- $char = $matches[0]{$i};
+ $char = $matches[0][$i];
if ($char == $delim) {
break;
} else {
diff --git a/Text/Wiki/Parse/Default/Smiley.php b/Text/Wiki/Parse/Default/Smiley.php
index ce295b4..2e1d10b 100644
--- a/Text/Wiki/Parse/Default/Smiley.php
+++ b/Text/Wiki/Parse/Default/Smiley.php
@@ -111,15 +111,15 @@ class Text_Wiki_Parse_Smiley extends Text_Wiki_Parse {
$cur = $smiley;
}
$len = strlen($cur);
- if (($cur{0} == ':') && ($len > 2) && ($cur{$len - 1} == ':')) {
+ if (($cur[0] == ':') && ($len > 2) && ($cur[$len - 1] == ':')) {
$reg1 .= $sep1 . preg_quote(substr($cur, 1, -1), '#');
$sep1 = '|';
continue;
}
if ($autoNose && ($len === 2)) {
- $variante = $cur{0} . '-' . $cur{1};
+ $variante = $cur[0] . '-' . $cur[1];
$this->_smileys[$variante] = &$this->_smileys[$smiley];
- $cur = preg_quote($cur{0}, '#') . '-?' . preg_quote($cur{1}, '#');
+ $cur = preg_quote($cur[0], '#') . '-?' . preg_quote($cur[1], '#');
} else {
$cur = preg_quote($cur, '#');
}
diff --git a/Text/Wiki/Parse/Default/Wikilink.php b/Text/Wiki/Parse/Default/Wikilink.php
index 8a33e43..f0bafd1 100755
--- a/Text/Wiki/Parse/Default/Wikilink.php
+++ b/Text/Wiki/Parse/Default/Wikilink.php
@@ -186,7 +186,7 @@ class Text_Wiki_Parse_Wikilink extends Text_Wiki_Parse {
{
// when prefixed with !, it's explicitly not a wiki link.
// return everything as it was.
- if ($matches[2]{0} == '!') {
+ if ($matches[2][0] == '!') {
return $matches[1] . substr($matches[2], 1) . $matches[3];
}
diff --git a/Text/Wiki/Parse/Doku/Paragraph.php b/Text/Wiki/Parse/Doku/Paragraph.php
index 8a535ef..18c3acc 100644
--- a/Text/Wiki/Parse/Doku/Paragraph.php
+++ b/Text/Wiki/Parse/Doku/Paragraph.php
@@ -112,7 +112,7 @@ class Text_Wiki_Parse_Paragraph extends Text_Wiki_Parse {
$key = '';
$len = strlen($matches[0]);
for ($i = 1; $i < $len; $i++) {
- $char = $matches[0]{$i};
+ $char = $matches[0][$i];
if ($char == $delim) {
break;
} else {
diff --git a/Text/Wiki/Parse/Mediawiki/Table.php b/Text/Wiki/Parse/Mediawiki/Table.php
index 0622ae0..2150d47 100644
--- a/Text/Wiki/Parse/Mediawiki/Table.php
+++ b/Text/Wiki/Parse/Mediawiki/Table.php
@@ -260,7 +260,7 @@ class Text_Wiki_Parse_Table extends Text_Wiki_Parse {
}
$param = array(
'type' => 'cell_start',
- 'attr' => $matches[1] && ($matches[1]{0} == '!') ? 'header': null,
+ 'attr' => $matches[1] && ($matches[1][0] == '!') ? 'header': null,
'span' => 1,
'rowspan' => 1,
'order' => $order
diff --git a/Text/Wiki/Parse/Tiki/Paragraph.php b/Text/Wiki/Parse/Tiki/Paragraph.php
index 410d512..0441649 100755
--- a/Text/Wiki/Parse/Tiki/Paragraph.php
+++ b/Text/Wiki/Parse/Tiki/Paragraph.php
@@ -114,7 +114,7 @@ class Text_Wiki_Parse_Paragraph extends Text_Wiki_Parse {
$key = '';
$len = strlen($matches[0]);
for ($i = 1; $i < $len; $i++) {
- $char = $matches[0]{$i};
+ $char = $matches[0][$i];
if ($char == $delim) {
break;
} else {
diff --git a/Text/Wiki/Parse/Tiki/Plugin.php b/Text/Wiki/Parse/Tiki/Plugin.php
index e70c201..dd1f46c 100644
--- a/Text/Wiki/Parse/Tiki/Plugin.php
+++ b/Text/Wiki/Parse/Tiki/Plugin.php
@@ -115,7 +115,7 @@ class Text_Wiki_Parse_Plugin extends Text_Wiki_Parse {
preg_match_all($this->regexArgs, $matches[2], $args, PREG_PATTERN_ORDER);
$attr = array();
foreach ($args[1] as $i=>$name) {
- if ($args[2][$i]{0} == '"' || $args[2][$i]{0} == "'") {
+ if ($args[2][$i][0] == '"' || $args[2][$i][0] == "'") {
$attr[$name] = substr($args[2][$i], 1, -1);
} else {
$attr[$name] = trim($args[2][$i]);
diff --git a/Text/Wiki/Parse/Tiki/Wikilink.php b/Text/Wiki/Parse/Tiki/Wikilink.php
index 3cb279e..14d17b1 100755
--- a/Text/Wiki/Parse/Tiki/Wikilink.php
+++ b/Text/Wiki/Parse/Tiki/Wikilink.php
@@ -195,7 +195,7 @@ class Text_Wiki_Parse_Wikilink extends Text_Wiki_Parse {
{
// when prefixed with !, it's explicitly not a wiki link.
// return everything as it was.
- /*if ($matches[3]{0} == '!') {
+ /*if ($matches[3][0] == '!') {
return $matches[1] . substr($matches[3], 1) . $matches[4] . $matches[7];
}*/
if (isset($matches[2]) && $matches[2] == '))' && isset($matches[5]) && $matches[5] == '((') {
diff --git a/Text/Wiki/Render/Docbook/Colortext.php b/Text/Wiki/Render/Docbook/Colortext.php
index b0ed39f..7b49870 100644
--- a/Text/Wiki/Render/Docbook/Colortext.php
+++ b/Text/Wiki/Render/Docbook/Colortext.php
@@ -70,7 +70,7 @@ class Text_Wiki_Render_Docbook_Colortext extends Text_Wiki_Render {
$color = $options['color'];
if (!in_array($color, $this->getConf('colors', array())) &&
- $color{0} != '#') {
+ $color[0] != '#') {
$color = '#' . $color;
}
return '<phrase role="' . $this->getConf('role', 'color') . '" ' .
diff --git a/Text/Wiki/Render/Docbook/Url.php b/Text/Wiki/Render/Docbook/Url.php
index 1c42f19..2e012c7 100644
--- a/Text/Wiki/Render/Docbook/Url.php
+++ b/Text/Wiki/Render/Docbook/Url.php
@@ -77,7 +77,7 @@ class Text_Wiki_Render_Docbook_Url extends Text_Wiki_Render {
} else {
// should we build a target clause?
- if ($href{0} == '#' ||
+ if ($href[0] == '#' ||
strtolower(substr($href, 0, 7)) == 'mailto:') {
// targets not allowed for on-page anchors
// and mailto: links.
diff --git a/Text/Wiki/Render/Xhtml/Colortext.php b/Text/Wiki/Render/Xhtml/Colortext.php
index d0298ab..e93c4a0 100755
--- a/Text/Wiki/Render/Xhtml/Colortext.php
+++ b/Text/Wiki/Render/Xhtml/Colortext.php
@@ -63,7 +63,7 @@ class Text_Wiki_Render_Xhtml_Colortext extends Text_Wiki_Render {
$type = $options['type'];
$color = $options['color'];
- if (! in_array($color, $this->colors) && $color{0} != '#') {
+ if (! in_array($color, $this->colors) && $color[0] != '#') {
$color = '#' . $color;
}
diff --git a/Text/Wiki/Render/Xhtml/Url.php b/Text/Wiki/Render/Xhtml/Url.php
index 794ba16..576fa51 100755
--- a/Text/Wiki/Render/Xhtml/Url.php
+++ b/Text/Wiki/Render/Xhtml/Url.php
@@ -79,7 +79,7 @@ class Text_Wiki_Render_Xhtml_Url extends Text_Wiki_Render {
} else {
// should we build a target clause?
- if ($href{0} == '#' ||
+ if ($href[0] == '#' ||
strtolower(substr($href, 0, 7)) == 'mailto:') {
// targets not allowed for on-page anchors
// and mailto: links.
diff --git a/lib/FirePHP/FirePHP.class.php b/lib/FirePHP/FirePHP.class.php
index 4744335..1e065b5 100644
--- a/lib/FirePHP/FirePHP.class.php
+++ b/lib/FirePHP/FirePHP.class.php
@@ -1323,7 +1323,7 @@ class FirePHP {
$name = $raw_name;
- if ($name{0} == "\0") {
+ if ($name[0] == "\0") {
$parts = explode("\0", $name);
$name = $parts[2];
}
@@ -1502,17 +1502,17 @@ class FirePHP {
case 2:
// return a UTF-16 character from a 2-byte UTF-8 char
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- return chr(0x07 & (ord($utf8{0}) >> 2))
- . chr((0xC0 & (ord($utf8{0}) << 6))
- | (0x3F & ord($utf8{1})));
+ return chr(0x07 & (ord($utf8[0]) >> 2))
+ . chr((0xC0 & (ord($utf8[0]) << 6))
+ | (0x3F & ord($utf8[1])));
case 3:
// return a UTF-16 character from a 3-byte UTF-8 char
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- return chr((0xF0 & (ord($utf8{0}) << 4))
- | (0x0F & (ord($utf8{1}) >> 2)))
- . chr((0xC0 & (ord($utf8{1}) << 6))
- | (0x7F & ord($utf8{2})));
+ return chr((0xF0 & (ord($utf8[0]) << 4))
+ | (0x0F & (ord($utf8[1]) >> 2)))
+ . chr((0xC0 & (ord($utf8[1]) << 6))
+ | (0x7F & ord($utf8[2])));
}
// ignoring UTF-32 for now, sorry
@@ -1564,7 +1564,7 @@ class FirePHP {
*/
for ($c = 0; $c < $strlen_var; ++$c) {
- $ord_var_c = ord($var{$c});
+ $ord_var_c = ord($var[$c]);
switch (true) {
case $ord_var_c == 0x08:
@@ -1587,18 +1587,18 @@ class FirePHP {
case $ord_var_c == 0x2F:
case $ord_var_c == 0x5C:
// double quote, slash, slosh
- $ascii .= '\\'.$var{$c};
+ $ascii .= '\\'.$var[$c];
break;
case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
// characters U-00000000 - U-0000007F (same as ASCII)
- $ascii .= $var{$c};
+ $ascii .= $var[$c];
break;
case (($ord_var_c & 0xE0) == 0xC0):
// characters U-00000080 - U-000007FF, mask 110XXXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
- $char = pack('C*', $ord_var_c, ord($var{$c + 1}));
+ $char = pack('C*', $ord_var_c, ord($var[$c + 1]));
$c += 1;
$utf16 = $this->json_utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -1608,8 +1608,8 @@ class FirePHP {
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
- ord($var{$c + 1}),
- ord($var{$c + 2}));
+ ord($var[$c + 1]),
+ ord($var[$c + 2]));
$c += 2;
$utf16 = $this->json_utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -1619,9 +1619,9 @@ class FirePHP {
// characters U-00010000 - U-001FFFFF, mask 11110XXX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
- ord($var{$c + 1}),
- ord($var{$c + 2}),
- ord($var{$c + 3}));
+ ord($var[$c + 1]),
+ ord($var[$c + 2]),
+ ord($var[$c + 3]));
$c += 3;
$utf16 = $this->json_utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -1631,10 +1631,10 @@ class FirePHP {
// characters U-00200000 - U-03FFFFFF, mask 111110XX
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
- ord($var{$c + 1}),
- ord($var{$c + 2}),
- ord($var{$c + 3}),
- ord($var{$c + 4}));
+ ord($var[$c + 1]),
+ ord($var[$c + 2]),
+ ord($var[$c + 3]),
+ ord($var[$c + 4]));
$c += 4;
$utf16 = $this->json_utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -1644,11 +1644,11 @@ class FirePHP {
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
$char = pack('C*', $ord_var_c,
- ord($var{$c + 1}),
- ord($var{$c + 2}),
- ord($var{$c + 3}),
- ord($var{$c + 4}),
- ord($var{$c + 5}));
+ ord($var[$c + 1]),
+ ord($var[$c + 2]),
+ ord($var[$c + 3]),
+ ord($var[$c + 4]),
+ ord($var[$c + 5]));
$c += 5;
$utf16 = $this->json_utf82utf16($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
......@@ -79,7 +79,7 @@ class AttributeLib extends TikiDb_Bridge
return false;
}
if ($value == '') {
if ($value === '') {
$this->attributes->delete(
[
'type' => $type,
......
......@@ -53,7 +53,7 @@ class Text_Diff_Renderer_character_inline extends Tiki_Text_Diff_Renderer
return str_replace("<br />", "↵<br />", join("", $lines));
}
protected function _lines($type, $lines, $prefix = '')
protected function _lines($lines, $prefix = '', $suffix = '', $type = '')
{
if ($type == 'context') {
$this->diff .= join("", $lines);
......@@ -81,7 +81,7 @@ class Text_Diff_Renderer_character_inline extends Tiki_Text_Diff_Renderer
protected function _context($lines)
{
$this->_lines('context', $lines);
$this->_lines($lines, '', '', 'context');
}
protected function _added($lines, $changemode = false)
......@@ -94,9 +94,9 @@ class Text_Diff_Renderer_character_inline extends Tiki_Text_Diff_Renderer
}
if ($changemode) {
$this->_lines('change-added', $lines, '+');
$this->_lines($lines, '+', '', 'change-added');
} else {
$this->_lines('added', $lines, '+');
$this->_lines($lines, '+', '', 'added');
}
}
......@@ -110,15 +110,15 @@ class Text_Diff_Renderer_character_inline extends Tiki_Text_Diff_Renderer
}
if ($changemode) {
$this->_lines('change-deleted', $lines, '-');
$this->_lines($lines, '-', '', 'change-deleted');
} else {
$this->_lines('deleted', $lines, '-');
$this->_lines($lines, '-', '', 'deleted');
}
}
protected function _changed($orig, $final)
{
$this->change = 'changed';
$this->_lines('changed', [$orig, $final], '*');
$this->_lines([$orig, $final], '*', '', 'changed');
}
}
......@@ -1884,7 +1884,7 @@ class FileGalLib extends TikiLib
}
/* move files to file system
* return '' if ok otherwise error message */
public function moveFiles($to = 'to_fs', &$feedbacks)
public function moveFiles($to = 'to_fs', &$feedbacks = [])
{
$files = $this->table('tiki_files');
......@@ -1898,7 +1898,7 @@ class FileGalLib extends TikiLib
$nb = 0;
foreach ($result as $fileId) {
if (($errors = $this->moveFile($to, $fileId)) != '') {
if (($errors = $this->moveFile($fileId, $to)) != '') {
$feedbacks[] = "$msg $nb";
return $errors;
}
......@@ -1907,7 +1907,7 @@ class FileGalLib extends TikiLib
$feedbacks[] = "$msg $nb";
return '';
}
public function moveFile($to = 'to_fs', $file_id)
public function moveFile($file_id, $to = 'to_fs')
{
global $prefs;
$files = $this->table('tiki_files');
......
......@@ -31,7 +31,7 @@ class MLModelTest extends TikiTestCase
$prefs['feature_trackers'] = 'y';
$prefs['feature_machine_learning'] = 'y';
parent::setUp();
parent::setUpBeforeClass();
self::$trklib = TikiLib::lib('trk');
self::$mllib = TikiLib::lib('ml');
......@@ -92,7 +92,7 @@ class MLModelTest extends TikiTestCase
$prefs['feature_trackers'] = self::$old_prefs['feature_trackers'];
$prefs['feature_machine_learning'] = self::$old_prefs['feature_machine_learning'];
parent::tearDown();
parent::tearDownAfterClass();
self::$trklib->remove_tracker(self::$trackerId);
self::$mllib->delete_model(self::$mlt['mlmId']);
......
......@@ -22,7 +22,7 @@ class TrackerItemPermissionTest extends TikiTestCase
self::$old_pref = $prefs['feature_trackers'];
$prefs['feature_trackers'] = 'y';
parent::setUp();
parent::setUpBeforeClass();
self::$trklib = TikiLib::lib('trk');
// create tracker and couple of fields
......@@ -107,7 +107,7 @@ class TrackerItemPermissionTest extends TikiTestCase
global $prefs;
$prefs['feature_trackers'] = self::$old_pref;
parent::tearDown();
parent::tearDownAfterClass();
self::$trklib->remove_tracker(self::$trackerId);
if (! empty($prefs['unified_mysql_index_current'])) {
......
......@@ -82,6 +82,13 @@ if (! $installer->tableExists('tiki_preferences')) {
}
}
// These values are set on console.php
// which is not executed by unit tests
const DB_RUNNING = true;
const DB_STATUS = true;
const DB_TIKI_SETUP = true;
const DB_SYNCHRONAL = true;
$smarty = TikiLib::lib('smarty');
$smarty->addPluginsDir('../smarty_tiki/');
$cachelib = TikiLib::lib('cache');
......
......@@ -27,7 +27,8 @@ class TikiImporter_Blog_Wordpress_Test extends TikiImporter_TestCase
{
TikiDb::get()->query('DELETE FROM tiki_pages WHERE pageName = "materia"');
TikiDb::get()->query('DELETE FROM tiki_blog_posts WHERE postId = 10');
unset($GLOBALS['prefs']['feature_sefurl'], $GLOBALS['base_url']);
unset($GLOBALS['base_url']);
$GLOBALS['prefs']['feature_sefurl'] = 'n';
}
public function testImport(): void
......
......@@ -4337,7 +4337,7 @@ class TikiLib extends TikiDb_Bridge
* @param null $bindvars
* @return bool
*/
public function _get_values($table, $field_name, $var_names = null, &$global_ref, $query_cond = '', $bindvars = null)
public function _get_values($table, $field_name, $var_names = null, &$global_ref = [], $query_cond = '', $bindvars = null)
{
if (empty($table) || empty($field_name)) {
return false;
......
......@@ -4688,7 +4688,7 @@ class TrackerLib extends TikiLib
/* get the fields from the pretty tracker template
* return a list of fieldIds
*/
public function get_pretty_fieldIds($resource, $type = 'wiki', &$prettyModifier, $trackerId = 0)
public function get_pretty_fieldIds($resource, $type = 'wiki', &$prettyModifier = [], $trackerId = 0)
{
$tikilib = TikiLib::lib('tiki');
$smarty = TikiLib::lib('smarty');
......
......@@ -596,7 +596,7 @@ function wikiplugin_trackerFilter_split_filters($filters)
return $list;
}
function wikiplugin_trackerFilter_get_filters($trackerId = 0, array $listfields = [], &$formats, $status = 'opc')
function wikiplugin_trackerFilter_get_filters($trackerId = 0, array $listfields = [], &$formats = [], $status = 'opc')
{
global $tiki_p_admin_trackers;
$trklib = TikiLib::lib('trk');
......
......@@ -1602,16 +1602,9 @@ class WikiLib extends TikiLib
public function get_page_auto_toc($pageName)
{
$attributes = TikiLib::lib('attribute')->get_attributes('wiki page', $pageName);
$rc = 0;
if (! isset($attributes['tiki.wiki.autotoc'])) {
return 0;
}
$value = (int)$attributes['tiki.wiki.autotoc'];