Fix PHP 5.5 compatibility
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 5 Aug 2020 14:17:16 +0000 (16:17 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 5 Aug 2020 14:21:29 +0000 (16:21 +0200)
see b044815dd9b6509fc44219684d7076cd28a80aa6
see #3480

wcfsetup/install/files/lib/data/article/ArticleAction.class.php

index 5499048e3438f9310231827c4cea7c9ada6d0da7..cb39904700017bf0ef13a85981d13812aab5ddcb 100644 (file)
@@ -277,7 +277,10 @@ class ArticleAction extends AbstractDatabaseObjectAction {
                        }
                        
                        if ($article->publicationStatus == Article::PUBLISHED) {
-                               $usersToArticles[$article->userID] = ($usersToArticles[$article->userID] ?? 0) - 1;
+                               if (!isset($usersToArticles[$article->userID])) {
+                                       $usersToArticles[$article->userID] = 0;
+                               }
+                               $usersToArticles[$article->userID]--;
                        }
                }