Dotclear

Changeset 862:df7e300dd97a


Ignore:
Timestamp:
08/03/12 11:03:15 (13 years ago)
Author:
JcDenis
Branch:
default
Children:
863:88e1ebd4efa0, 1024:19c13e071c33
Message:

Fixes empty title on feed reader widget, fixes #1282

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/widgets/_widgets_functions.php

    r776 r862  
    250250          $i = 0; 
    251251          foreach ($feed->items as $item) { 
    252                $li = isset($item->link) ? '<a href="'.html::escapeHTML($item->link).'">'.$item->title.'</a>' : $item->title; 
     252               $title = isset($item->title) && strlen(trim($item->title)) ? $item->title : ''; 
     253               $link = isset($item->link) && strlen(trim($item->link)) ? $item->link : ''; 
     254                
     255               if (!$link && !$title) { 
     256                    continue; 
     257               } 
     258                
     259               if (!$title) { 
     260                    $title = substr($link,0,25).'...'; 
     261               } 
     262                
     263               $li = $link ? '<a href="'.html::escapeHTML($item->link).'">'.$title.'</a>' : $title; 
    253264               $res .= ' <li>'.$li.'</li> '; 
    254265               $i++; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map