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,7 +323,7 @@ Source: <input type="text" value="<?=Users::get_upload_sources()[0]?>" size="20"
323 323
     }
324 324
 ?>
325 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 327
           <script>
328 328
             if ($('#ressel').raw().value == "Other") {
329 329
               $('#resolution').raw().readOnly = false
@@ -573,7 +573,7 @@ Source: <input type="text" value="<?=Users::get_upload_sources()[0]?>" size="20"
573 573
 <?
574 574
     foreach($this->Resolutions as $Res) {
575 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 577
         echo " selected";
578 578
         $FoundRes = true;
579 579
       }

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

@@ -54,7 +54,8 @@ $Properties['Container'] = isset($_POST['container']) ? $_POST['container'] : ''
54 54
 $Properties['Media'] = $_POST['media'];
55 55
 
56 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 59
 $Properties['AudioFormat'] = isset($_POST['audioformat']) ? $_POST['audioformat'] : '';
59 60
 $Properties['Subbing'] = isset($_POST['sub']) ? $_POST['sub'] : '';
60 61
 $Properties['Language'] = isset($_POST['lang']) ? $_POST['lang'] : '';

Loading…
Cancel
Save