[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Index rebuild: fix undefined array key and initialized string warning.
Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]> Thu, 09 Jul 2026 15:42:15 +0000
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <6a4fc157867c1_3819b93c70048@gitlab-sidekiq-low-urgency-cpu-bound-v2-5798c8dbf-rxmnr.mail> |
Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
859ea9bb by Boss Ibrahim Mussa Gregoire at 2026-07-09T15:22:52+00:00
[FIX] Index rebuild: fix undefined array key and initialized string warning.
---
* [FIX] index rebuild: fix undefined array key and initialized string warning.
See merge request tikiwiki/tiki!7028
- - - - -
8 changed files:
- lang/fr/language.php
- lib/core/WikiParser/Markdown/CollapsibleHeadingProcessor.php
- lib/parser/parserlib.php
- lib/wiki-plugins/wikiplugin_attach.php
- lib/wiki-plugins/wikiplugin_fancytable.php
- lib/wiki-plugins/wikiplugin_img.php
- lib/wiki-plugins/wikiplugin_mediaplayer.php
- lib/wiki-plugins/wikiplugin_translated.php
Changes:
=====================================
lang/fr/language.php
=====================================
@@ -12041,6 +12041,7 @@ $lang_current = array(
"PDF.js feature is disabled. If you do not have permission to enable, ask the site administrator to activate 'fgal_pdfjs_feature'." => "La fonctionnalité PDF.js est désactivée. Si vous n'avez pas la permission de l'activer, demandez à l'administrateur du site d'activer 'fgal_pdfjs_feature'.",
"PluginMediaPlayer: The file is not a text file." => "PluginMediaPlayer: Le fichier n'est pas un fichier texte.",
"PluginMediaPlayer: Unable to open the file %0. It may not exist or is inaccessible." => "PluginMediaPlayer: Impossible d'ouvrir le fichier %0. Il peut ne pas exister ou il est inaccessible.",
+"PluginMediaPlayer failed to reach the remote server: %0." => "Le plugin MediaPlayer n'a pas pu atteindre le serveur distant: %0.",
"Download file" => "Télécharger le fichier",
"Member List" => "Liste des membres",
"List and allow editing of group members" => "Lister et autoriser la modification des membres du groupe",
=====================================
lib/core/WikiParser/Markdown/CollapsibleHeadingProcessor.php
=====================================
@@ -6,23 +6,22 @@
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
namespace Tiki\WikiParser\Markdown;
+use Exception;
use League\CommonMark\Event\DocumentParsedEvent;
use League\CommonMark\Node\NodeIterator;
-use League\CommonMark\Node\RawMarkupContainerInterface;
-use League\CommonMark\Node\StringContainerHelper;
-use League\CommonMark\Normalizer\TextNormalizerInterface;
-use League\Config\ConfigurationInterface;
-use League\Config\Exception\InvalidConfigurationException;
use Tiki\WikiParser\Markdown\Node\CollapsibleHeading;
use Tiki\WikiParser\Markdown\Node\CollapsibleContainer;
use Tiki\WikiParser\Markdown\Node\CollapsibleLink;
/**
* Searches the Document for CollapsibleHeading elements, adds a [+]/[-] link and
- * surrounds next block element with special collapsible div
+ * surrounds the next block element with special collapsible div
*/
class CollapsibleHeadingProcessor
{
+ /**
+ * @throws Exception
+ */
public function __invoke(DocumentParsedEvent $e): void
{
global $page;
=====================================
lib/parser/parserlib.php
=====================================
@@ -2083,7 +2083,7 @@ class ParserLib extends TikiDb_Bridge
return;
}
- if ($prefs['feature_wiki_argvariable'] == 'y' && ! $this->option['wysiwyg']) {
+ if ($prefs['feature_wiki_argvariable'] == 'y' && (! isset($this->option['wysiwyg']) || ! $this->option['wysiwyg'])) {
if (preg_match_all("/\\{\\{((\w+)(\\|([^\\}]*))?)\\}\\}/", $data ?? '', $args, PREG_SET_ORDER)) {
$needles = [];
$replacements = [];
=====================================
lib/wiki-plugins/wikiplugin_attach.php
=====================================
@@ -172,6 +172,8 @@ function wikiplugin_attach($data, $params)
$wikilib = TikiLib::lib('wiki');
$tikilib = TikiLib::lib('tiki');
+ $params = WikiPlugin_Helper::applyParamsDefaults($params, wikiplugin_attach_info());
+
extract($params, EXTR_SKIP);
$loop = [];
@@ -216,7 +218,7 @@ function wikiplugin_attach($data, $params)
if (! $tikilib->page_exists($page)) {
return "''" . tr('Page "%0" does not exist', $page) . "''";
}
- if ($tikilib->user_has_perm_on_object($user, $page, 'wiki page', 'tiki_p_wiki_view_attachments') || $tikilib->user_has_perm_on_object($user, $_REQUEST['page'], 'wiki page', 'tiki_p_wiki_admin_attachments')) {
+ if ($tikilib->user_has_perm_on_object($user, $page, 'wiki page', 'tiki_p_wiki_view_attachments')) {
$atts = $wikilib->list_wiki_attachments($page, 0, -1, 'created_desc', '');
$url = "&page=$page";
}
=====================================
lib/wiki-plugins/wikiplugin_fancytable.php
=====================================
@@ -21,6 +21,7 @@ function wikiplugin_fancytable_info()
'required' => false,
'name' => tra('Heading Row'),
'description' => tr('Header rows of the table. Use %0 to separate multiple rows.', '<code>>></code>'),
+ 'default' => '',
'since' => '1'
],
'headclass' => [
@@ -143,6 +144,9 @@ function wikiplugin_fancytable($data, $params)
// Initialize variables
$tagremove = [];
$pluginremove = [];
+
+ $params = WikiPlugin_Helper::applyParamsDefaults($params, wikiplugin_fancytable_info());
+
static $iFancytable = 0;
++$iFancytable;
$msg = '';
=====================================
lib/wiki-plugins/wikiplugin_img.php
=====================================
@@ -602,6 +602,8 @@ function wikiplugin_img($data, $params)
$userlib = TikiLib::lib('user');
$smarty = TikiLib::lib('smarty');
+ $pluginInfo = wikiplugin_img_info();
+
$imgdata = [];
$imgdata['galleryId'] = '';
$imgdata['alt'] = '';
=====================================
lib/wiki-plugins/wikiplugin_mediaplayer.php
=====================================
@@ -4,6 +4,8 @@
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
+use GuzzleHttp\Client;
+use GuzzleHttp\Exception\ClientException;
use Tiki\Package\VendorHelper;
const AUDIO_ACCEPTED_FORMATS = ['mp3', 'ogg', 'wav', 'aac', 'flac', 'opus'];
@@ -159,16 +161,23 @@ function wikiplugin_mediaplayer($data, $params)
}
}
} else {
- // External link.
- $headers = get_headers($sourceLink, 1);
-
- // Check if the file exists on the remote server.
- if ($headers === false || ! isset($headers['Content-Disposition'])) {
- Feedback::error(tr("PluginMediaPlayer: File %0 not found on the remote server.", $params['src']));
+ // get file Headers information
+ $headers = [];
+ $client = new Client();
+ try {
+ $response = $client->head($sourceLink);
+ $headers = $response->getHeaders();
+ } catch (ClientException $e) {
+ $message = tr('PluginMediaPlayer: File %0 not found on the remote server.', $params['src']);
+ if ($e->getResponse()->getStatusCode() !== 404) {
+ $message = tr('PluginMediaPlayer failed to reach the remote server: %0.', $e->getResponse()->getReasonPhrase());
+ }
+ Feedback::error($message);
return '';
}
+
if (isset($headers['Content-Disposition'])) {
- $disposition = $headers['Content-Disposition'];
+ $disposition = $headers['Content-Disposition'][0];
if (preg_match('/filename="(.+)"/', $disposition, $matches)) {
$filename = $matches[1];
$extension = pathinfo($filename, PATHINFO_EXTENSION);
=====================================
lib/wiki-plugins/wikiplugin_translated.php
=====================================
@@ -51,7 +51,7 @@ function wikiplugin_translated($data, $params)
}
}
if (in_array($flag, $avflags)) {
- $img = "<img src='img/flags/{$escapedFlag}.png' alt='{$escapedLang}' style='width:18px; height:13px; margin:0 3px 0 0; vertical-align:baseline;' />";
+ $img = "<img src='img/flags/$flag.png' alt='$flag' style='width:18px; height:13px; margin:0 3px 0 0; vertical-align:baseline;' />";
}
if (! $img) {
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/859ea9bbbc1eb4f9db7f7c04dd323866c00b23d8
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/859ea9bbbc1eb4f9db7f7c04dd323866c00b23d8
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs