Browse Source

Upload form: Fix resolution bug

spaghetti 7 years ago
parent
commit
a23bb85827
2 changed files with 4 additions and 3 deletions
  1. 2
    2
      classes/torrent_form.class.php
  2. 2
    1
      sections/upload/upload_handle.php

+ 2
- 2
classes/torrent_form.class.php View File

323
     }
323
     }
324
 ?>
324
 ?>
325
           </select>
325
           </select>
326
-          <input type="text" id="resolution" name="resolution" size="10" class="hidden tooltip" title='Enter "Other" resolutions in the form ###x###' value="<?=$Torrent['Resolution']?>" readonly></input>
326
+          <input type="text" id="resolution" name="resolution" size="10" class="hidden tooltip" pattern="[0-9]+x[0-9]+" title='Enter "Other" resolutions in the form ###x###' value="<?=$Torrent['Resolution']?>" readonly></input>
327
           <script>
327
           <script>
328
             if ($('#ressel').raw().value == "Other") {
328
             if ($('#ressel').raw().value == "Other") {
329
               $('#resolution').raw().readOnly = false
329
               $('#resolution').raw().readOnly = false
573
 <?
573
 <?
574
     foreach($this->Resolutions as $Res) {
574
     foreach($this->Resolutions as $Res) {
575
       echo "\t\t\t\t\t\t<option value=\"$Res\"";
575
       echo "\t\t\t\t\t\t<option value=\"$Res\"";
576
-      if ($Res == $Torrent['Resolution'] || (!isset($FoundRes) && isset($Torrent ['Resolution']) && $Res == "Other")) {
576
+      if ($Res == $Torrent['Resolution'] || (!isset($FoundRes) && isset($Torrent['Resolution']) && $Res == "Other")) {
577
         echo " selected";
577
         echo " selected";
578
         $FoundRes = true;
578
         $FoundRes = true;
579
       }
579
       }

+ 2
- 1
sections/upload/upload_handle.php View File

54
 $Properties['Media'] = $_POST['media'];
54
 $Properties['Media'] = $_POST['media'];
55
 
55
 
56
 $Properties['Codec'] = isset($_POST['codec']) ? $_POST['codec'] : '';
56
 $Properties['Codec'] = isset($_POST['codec']) ? $_POST['codec'] : '';
57
-$Properties['Resolution'] = isset($_POST['resolution']) ? $_POST['resolution'] : '';
57
+if (!($_POST['resolution'] ?? false)) $_POST['resolution'] = $_POST['ressel'] ?? '';
58
+$Properties['Resolution'] = $_POST['resolution'] ?? '';
58
 $Properties['AudioFormat'] = isset($_POST['audioformat']) ? $_POST['audioformat'] : '';
59
 $Properties['AudioFormat'] = isset($_POST['audioformat']) ? $_POST['audioformat'] : '';
59
 $Properties['Subbing'] = isset($_POST['sub']) ? $_POST['sub'] : '';
60
 $Properties['Subbing'] = isset($_POST['sub']) ? $_POST['sub'] : '';
60
 $Properties['Language'] = isset($_POST['lang']) ? $_POST['lang'] : '';
61
 $Properties['Language'] = isset($_POST['lang']) ? $_POST['lang'] : '';

Loading…
Cancel
Save