Changeset 31781

Show
Ignore:
Timestamp:
07.07.2017 20:11:43 (5 months ago)
Author:
ak19
Message:

Adding in patches to cpan perl code as required to get the remote greenstone server to still work with perl v 5.22.1. Not tested these changes with out usual perl 5.18. I'm not getting a newer version of these modules from CPAN since I'm not sure whether there may be some compatibility issues of the newer versions with our existing code. So I'm making the smallest number of changes that will keep our code still working.

Location:
main/trunk/greenstone2/perllib/cpan
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/cpan/JSON/PP.pm

    r24921 r31781  
    14871487    $self->{incr_p} = 0; 
    14881488 
    1489     return $obj or ''; 
     1489    # To avoid syntax errors in newer versions of perl, 
     1490    # putting the return in brackets as explained at 
     1491    # https://rt.cpan.org/Public/Bug/Display.html?id=87302 
     1492    # "returns binds stronger than or, so the expressions after or are ignored. 
     1493    # See https://rt.perl.org/rt3/Public/Bug/Display.html?id=59802" 
     1494    return ($obj or ''); 
    14901495} 
    14911496 
  • main/trunk/greenstone2/perllib/cpan/URI/Escape.pm

    r27174 r31781  
    202202} 
    203203 
     204# https://rt.cpan.org/Public/Bug/Display.html?id=105109 
     205# https://github.com/libwww-perl/uri/commit/7e03cdd3e5d25df5556a36dbfcd5d6cbcd676afb 
     206# escape_char is buggy as it assigns meaning to the string's storage format. 
    204207sub escape_char { 
    205     return join '', @URI::Escape::escapes{$_[0] =~ /(\C)/g}; 
     208 
     209    # to fix new "\C is deprecated in regex" warning in 5.21.2 (RT#96941) 
     210    #return join '', @URI::Escape::escapes{$_[0] =~ /(\C)/g}; 
     211    if (utf8::is_utf8($_[0])) { 
     212        my $s = $_[0]; 
     213        utf8::encode($s); 
     214        unshift(@_, $s); 
     215    } 
     216     
     217    return join '', @URI::Escape::escapes{$_[0] =~ /(.)/sg}; 
    206218} 
    207219