Re: [TikiWiki-commits] [Git][tikiwiki/tiki][master] [Fix]lib/rss/rsslib.php : Initialize the variable before accessing it and...

test--- via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <[email protected]>
On Fri, 08 Nov 2024 17:01:27 +0000 [email protected], Tiki code commits information [email protected] said

> 
> 
> Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki
> 
> 
> Commits:
> 29b88486 by Joseph Ushindi at 2024-11-08T16:54:26+00:00
> [Fix]lib/rss/rsslib.php : Initialize the variable before accessing it and...
> ---
> * [Fix] Undefined variable : Initialize the variable before accessing it and
> added error handling for JSON decode failure
> 
> See merge request tikiwiki/tiki!6296
> 
> - - - - -
> 
> 
> 1 changed file:
> 
> - lib/rss/rsslib.php
> 
> 
> Changes:
> 
> =====================================
> lib/rss/rsslib.php
> =====================================
> @@ -672,7 +672,7 @@ class RSSLib extends TikiDb_Bridge
>         foreach ($feeds as $feed) {
>             if (isset($feed['categories'])) {
>                 foreach (json_decode($feed['categories']) as $sourcecat) {
> -                     $categories[$sourcecat] = [];
> +                    $categories[$sourcecat] = [];
>                 }
>             }
>         }
> @@ -737,13 +737,20 @@ class RSSLib extends TikiDb_Bridge
>             ]
>         );
> 
> -        $actions = json_decode($actions, true);
> +        if (is_string($actions) && ! empty($actions)) {
> +            $actions = json_decode($actions, true);
> +            if (json_last_error() !== JSON_ERROR_NONE) {
> +                throw new InvalidArgumentException('Invalid JSON string in
> actions: ' . json_last_error_msg());
> +            }
> +        } else {
> +            $actions = [];
> +        }
> 
>         //currently handles creation of articles through
> process_action_article()
> +        $actionCount = 0;
>         if (! empty($actions)) {
>             $pagecontentlib = TikiLib::lib('pagecontent');
>             $data = $pagecontentlib->augmentInformation($data);
> -            $actionCount = 0;
>             foreach ($actions as $action) {
>                 $method = 'process_action_' . $action['type'];
>                 unset($action['type']);
> 
> 
> 
> View it on GitLab:
> https://gitlab.com/tikiwiki/tiki/-/commit/29b8848672eedf20c61d2a1866e2b51c78493b99
> 
> -- 
> View it on GitLab:
> https://gitlab.com/tikiwiki/tiki/-/commit/29b8848672eedf20c61d2a1866e2b51c78493b99
> You're receiving this email because of your account on gitlab.com.
> 
> 
> 

Je suis trop gentil




_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.