• Resolved Jer Clarke

    (@jerclarke)


    Hi all, thanks as always for this incredible plugin and all the support you put into it.

    I discovered another one of those classic little bugs where an edge-case results in PHP warnings in the logs:

    [18-Aug-2025 16:50:23] PHP warning: "Undefined array key "pci_osm"" file: [...]/powerpress/powerpress.php:1498 url: globalvoices.org/-/special/global-voices-podcast/feed/ 

    Seems easy enough to fix, as the code just doesn’t validate that the array item isn’t empty before checking if it’s an array:

    if( !is_array($Feed['pci_geo']) && !empty($Feed['pci_geo']) ) {
    echo " geo=\"" . htmlspecialchars($Feed['pci_geo']) . "\"";
    }
    if( !is_array($Feed['pci_osm']) && !empty($Feed['pci_osm']) ) {
    echo " osm=\"" . htmlspecialchars($Feed['pci_osm']) . "\"";
    }

    Seems to me all we need to do is flip the order so it checks !empty() first, then check if it’s an array:

    if( !empty($Feed['pci_geo']) && !is_array($Feed['pci_geo']) ) {
    echo " geo=\"" . htmlspecialchars($Feed['pci_geo']) . "\"";
    }
    if( !empty($Feed['pci_osm']) && !is_array($Feed['pci_osm']) ) {
    echo " osm=\"" . htmlspecialchars($Feed['pci_osm']) . "\"";
    }

    I wasn’t able to replicate this issue using a local test site, but I’m going to update my live site and confirm this solves the problem for me and reply back.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Jer Clarke

    (@jerclarke)

    Update: I pushed that change to my live site and everything still seems to work. It definitely silenced the warning.

    Plugin Support Shawn

    (@shawnogordo)

    Thanks for the report! It has been passed on to the Blubrry dev team.

    Thread Starter Jer Clarke

    (@jerclarke)

    Thanks Shawn! I’ll close this ticket and look forward to removing my hotfix when the next version comes out. Always appreciate your team 🙏🏻

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘PHP Warning: “Undefined array key “pci_osm””’ is closed to new replies.