Plugin Directory

Changeset 1581907


Ignore:
Timestamp:
01/25/2017 01:57:20 PM (9 years ago)
Author:
plista
Message:

Fix undefined

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plista/trunk/plista_integration.php

    r1581889 r1581907  
    125125        $pattern = "/src=[\"']?([^\"']?.*(png|jpg|gif|jpeg))[\"']?/i";
    126126        $output = preg_match_all($pattern, $post->post_content, $matches);
    127         $first_img = $matches [1] [0];
     127        $first_img = '';
     128        if (!empty($matches[1][0])) {
     129            $first_img = $matches[1][0];
     130        }
    128131        // always remove title and alt attributes containing something like title="bild.jpg"
    129132        $first_img = preg_replace(array('/[\"]+/', '/ (alt|title)=?.*(png|jpg|gif|jpeg)/'), array('', ''), $first_img);
Note: See TracChangeset for help on using the changeset viewer.