Skip to content

Commit

Permalink
adjustments for Wikipedias move to HTTPS only
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstadler committed Jun 26, 2015
1 parent 08cc24e commit 3743ec7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/img.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ declare function img:retrieveImagesFromWikipedia($pnd as xs:string, $lang as xs:
let $caption := normalize-space(concat($div/xhtml:div[@class='thumbcaption'],' (', lang:get-language-string('sourceWikipedia', $lang), ')'))
let $tmpPicURI := $div//xhtml:img[@class='thumbimage']/string(@src)
let $picURI := (: Achtung: in $pics landen auch andere Medien, z.B. audio. Diese erzeugen dann aber ein leeres $tmpPicURI, da natürlich kein <img/> vorhanden :)
if(starts-with($tmpPicURI, '//')) then concat('http:', $tmpPicURI)
else if(starts-with($tmpPicURI, 'http')) then $tmpPicURI
if(starts-with($tmpPicURI, '//')) then concat('https:', $tmpPicURI)
else if(starts-with($tmpPicURI, 'http:')) then replace($tmpPicURI, 'http:', 'https:')
else if(starts-with($tmpPicURI, 'https:')) then $tmpPicURI
else ()
let $localURL := if($picURI castable as xs:anyURI) then img:retrievePicture(xs:anyURI($picURI), ()) else ()
return if(exists($localURL)) then
Expand Down

0 comments on commit 3743ec7

Please sign in to comment.