Skip to content

Non-array (or null) parameter passed to source_link() #3

Description

@GwynethLlewelyn

I'm getting the following error on Version 2010.0207 of this plugin, using FeedWordPress 2022.0222, running under PHP 8.2.10:

PHP Warning:  Uninitialized string offset 0 in /my/path/wp-content/plugins/add-attribution-feedwordpress/add-attribution-feedwordpress.php on line 268

This is essentially source_link() getting passed a null, or a zero, or worse

On line 268, just below the function source_link( $atts ) declaration, just add:

        if ( empty( $atts ) or ! is_array( $atts ) or empty( $atts[0] ) ) :
            return NULL;
        endif;

just before the switch.

This won't fix the issue, but at least stops PHP from complaining with a warning.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions