Jump to content

Topic on Extension talk:ArticleToCategory2

Schlagmichdoch (talkcontribs)

When using the current version with php 7.4 we got a bug whenever a category page is visited.

On top of the body following error message is printed:

<b>Notice</b>:  Uninitialized string offset: 0 in <b>/var/www/wiki/extensions/ArticleToCategory2/ArticleToCategory2Hooks.php</b> on line <b>49</b><br>

To fix this we need to change the File ArticleToCategory2Hooks.php:

                               foreach ( $c as $entry ) {
                                       if ( $entry[0] == ';' ) {
                                               $cat = trim( substr( $entry, 1 ) );
                                               $excludedCategories[] = $cat;
                                       }
                               }

Must be changed into:

                               foreach ( $c as $entry ) {
                                       if ( !empty($entry) && $entry[0] == ';' ) {
                                               $cat = trim( substr( $entry, 1 ) );
                                               $excludedCategories[] = $cat;
                                       }
                               }
Reply to "Bug"