Changeset 15838

Show
Ignore:
Timestamp:
30.05.2008 17:25:40 (12 years ago)
Author:
ak19
Message:

Updated the regular expression on img src link to make sure that single quotes embedded inside the link portion are not considered as marking the end of the link). Now it checks that the start and quotation marks match, i.e. starting single quote for a link should be matched by ending single quote and starting double quote with ending double quote

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/plugins/HTMLPlug.pm

    r15176 r15838  
    911911 
    912912    #if(!$self->{'no_image_links'}){ 
    913     $$textref =~ s/(<(?:img|embed|table|tr|td)[^>]*?(?:src|background)\s*=\s*)([\"\'][^\"\']+[\"\']|[^\s>]+)([^>]*>)/ 
     913    $$textref =~ s/(<(?:img|embed|table|tr|td)[^>]*?(?:src|background)\s*=\s*)(([\"][^\"]+[\"])|([\'][^\"\']+[\'])|([^\s\/>]+))([^>]*>)/ 
    914914    $self->replace_images ($1, $2, $3, $base_dir, $file, $doc_obj, $cursection)/isge; 
    915915    #} 
     
    930930    # remove quotes from link at start and end if necessary 
    931931    if ($link=~/^[\"\']/) { 
    932     $link=~s/^[\"\']//;$link=~s/[\"\']$//; 
     932    $link=~s/^[\"\']//; 
     933    $link=~s/[\"\']$//; 
    933934    $front.='"'; 
    934935    $back="\"$back"; 
    935936    } 
    936  
    937937    $link =~ s/\n/ /g; 
    938938