Browse Source

Autofill (JAV): Assume cover url protocol when not given

spaghetti 7 years ago
parent
commit
10a038c6fa
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      sections/ajax/javfill.php

+ 4
- 1
sections/ajax/javfill.php View File

121
     if (!$year) {
121
     if (!$year) {
122
        $year = substr($jdb->query("//div[@class='movieinfo']")[0]->childNodes[1]->childNodes[0]->nodeValue, strlen("Release Date: "), 4);
122
        $year = substr($jdb->query("//div[@class='movieinfo']")[0]->childNodes[1]->childNodes[0]->nodeValue, strlen("Release Date: "), 4);
123
     }
123
     }
124
-    if(!$image) {
124
+    if (!$image) {
125
       $image = $jdb->query('//*[@class="cover"]/a/img')->item(0)->getAttribute('src');
125
       $image = $jdb->query('//*[@class="cover"]/a/img')->item(0)->getAttribute('src');
126
     }
126
     }
127
+    if (substr($image, 0, 2) == '//') {
128
+      $image = 'https:'.$image;
129
+    }
127
     if (!$desc) {
130
     if (!$desc) {
128
       //Shit neither of the sites have descriptions
131
       //Shit neither of the sites have descriptions
129
       $desc = '';
132
       $desc = '';

Loading…
Cancel
Save