Browse Source

Silence torrent_form errors when adding new format

spaghetti 7 years ago
parent
commit
aa4ef62f73
1 changed files with 18 additions and 18 deletions
  1. 18
    18
      classes/torrent_form.class.php

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

103
       <input type="hidden" name="type" value="<?=display_str($this->Torrent['CategoryID']-1)?>" />
103
       <input type="hidden" name="type" value="<?=display_str($this->Torrent['CategoryID']-1)?>" />
104
 <?
104
 <?
105
       }
105
       }
106
-      if ($this->Torrent && $this->Torrent['RequestID']) {
106
+      if ($this->Torrent && ($this->Torrent['RequestID'] ?? false)) {
107
 ?>
107
 ?>
108
       <input type="hidden" name="requestid" value="<?=display_str($this->Torrent['RequestID'])?>" />
108
       <input type="hidden" name="requestid" value="<?=display_str($this->Torrent['RequestID'])?>" />
109
 <?
109
 <?
271
       </tr>
271
       </tr>
272
       <tr id="dlsite_tr">
272
       <tr id="dlsite_tr">
273
         <td class="label">DLsite ID</td>
273
         <td class="label">DLsite ID</td>
274
-        <td><input type="text" id="dlsiteid" name="dlsiteid" size="8" maxlength="8" value="<?=display_str($Torrent['DLsiteID'])?>" <?=$this->Disabled?>/></td>
274
+        <td><input type="text" id="dlsiteid" name="dlsiteid" size="8" maxlength="8" value="<?=display_str($Torrent['DLsiteID']??'')?>" <?=$this->Disabled?>/></td>
275
       </tr>
275
       </tr>
276
 <? } ?>
276
 <? } ?>
277
       <tr id="media_tr">
277
       <tr id="media_tr">
282
 <?
282
 <?
283
     foreach($this->Media as $Media) {
283
     foreach($this->Media as $Media) {
284
       echo "\t\t\t\t\t\t<option value=\"$Media\"";
284
       echo "\t\t\t\t\t\t<option value=\"$Media\"";
285
-      if ($Media == $Torrent['Media']) {
285
+      if ($Media == ($Torrent['Media'] ?? false)) {
286
         echo " selected";
286
         echo " selected";
287
       }
287
       }
288
       echo ">$Media</option>\n";
288
       echo ">$Media</option>\n";
299
 <?
299
 <?
300
     foreach($this->MediaManga as $Media) {
300
     foreach($this->MediaManga as $Media) {
301
       echo "\t\t\t\t\t\t<option value=\"$Media\"";
301
       echo "\t\t\t\t\t\t<option value=\"$Media\"";
302
-      if ($Media == $Torrent['Media']) {
302
+      if ($Media == ($Torrent['Media'] ?? false)) {
303
         echo " selected";
303
         echo " selected";
304
       }
304
       }
305
       echo ">$Media</option>\n";
305
       echo ">$Media</option>\n";
316
 <?
316
 <?
317
     foreach($this->Platform as $Platform) {
317
     foreach($this->Platform as $Platform) {
318
       echo "\t\t\t\t\t\t<option value=\"$Platform\"";
318
       echo "\t\t\t\t\t\t<option value=\"$Platform\"";
319
-      if ($Platform == $Torrent['Media']) {
319
+      if ($Platform == ($Torrent['Media'] ?? false)) {
320
         echo " selected";
320
         echo " selected";
321
       }
321
       }
322
       echo ">$Platform</option>\n";
322
       echo ">$Platform</option>\n";
333
 <?
333
 <?
334
     foreach($this->Archives as $Archive) {
334
     foreach($this->Archives as $Archive) {
335
       echo "\t\t\t\t\t\t<option value=\"$Archive\"";
335
       echo "\t\t\t\t\t\t<option value=\"$Archive\"";
336
-      if ($Archive == $Torrent['Archive']) {
336
+      if ($Archive == ($Torrent['Archive'] ?? false)) {
337
         echo ' selected';
337
         echo ' selected';
338
       }
338
       }
339
       echo ">$Archive</option>\n";
339
       echo ">$Archive</option>\n";
350
 <?
350
 <?
351
     foreach(array_merge($this->Archives, $this->ArchivesManga) as $Archive) {
351
     foreach(array_merge($this->Archives, $this->ArchivesManga) as $Archive) {
352
       echo "\t\t\t\t\t\t<option value=\"$Archive\"";
352
       echo "\t\t\t\t\t\t<option value=\"$Archive\"";
353
-      if ($Archive == $Torrent['Archive']) {
353
+      if ($Archive == ($Torrent['Archive'] ?? false)) {
354
         echo ' selected';
354
         echo ' selected';
355
       }
355
       }
356
       echo ">$Archive</option>\n";
356
       echo ">$Archive</option>\n";
367
 <?
367
 <?
368
     foreach($this->Containers as $Cont) {
368
     foreach($this->Containers as $Cont) {
369
       echo "\t\t\t\t\t\t<option value=\"$Cont\"";
369
       echo "\t\t\t\t\t\t<option value=\"$Cont\"";
370
-      if ($Cont == $Torrent['Container']) {
370
+      if ($Cont == ($Torrent['Container'] ?? false)) {
371
         echo " selected";
371
         echo " selected";
372
       }
372
       }
373
       echo ">$Cont</option>\n";
373
       echo ">$Cont</option>\n";
384
 <?
384
 <?
385
     foreach($this->ContainersGames as $Container) {
385
     foreach($this->ContainersGames as $Container) {
386
       echo "\t\t\t\t\t\t<option value=\"$Container\"";
386
       echo "\t\t\t\t\t\t<option value=\"$Container\"";
387
-      if ($Container == $Torrent['Container']) {
387
+      if ($Container == ($Torrent['Container'] ?? false)) {
388
         echo " selected";
388
         echo " selected";
389
       }
389
       }
390
       echo ">$Container</option>\n";
390
       echo ">$Container</option>\n";
401
 <?
401
 <?
402
     foreach($this->Codecs as $Codec) {
402
     foreach($this->Codecs as $Codec) {
403
       echo "\t\t\t\t\t\t<option value=\"$Codec\"";
403
       echo "\t\t\t\t\t\t<option value=\"$Codec\"";
404
-      if ($Codec == $Torrent['Codec']) {
404
+      if ($Codec == ($Torrent['Codec'] ?? false)) {
405
         echo " selected";
405
         echo " selected";
406
       }
406
       }
407
       echo ">$Codec</option>\n";
407
       echo ">$Codec</option>\n";
418
 <?
418
 <?
419
     foreach($this->Resolutions as $Res) {
419
     foreach($this->Resolutions as $Res) {
420
       echo "\t\t\t\t\t\t<option value=\"$Res\"";
420
       echo "\t\t\t\t\t\t<option value=\"$Res\"";
421
-      if ($Res == $Torrent['Resolution'] || (!isset($FoundRes) && ($Torrent['Resolution'] ?? false) && $Res == "Other")) {
421
+      if ($Res == ($Torrent['Resolution'] ?? false) || (!isset($FoundRes) && ($Torrent['Resolution'] ?? false) && $Res == "Other")) {
422
         echo " selected";
422
         echo " selected";
423
         $FoundRes = true;
423
         $FoundRes = true;
424
       }
424
       }
426
     }
426
     }
427
 ?>
427
 ?>
428
           </select>
428
           </select>
429
-          <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>
429
+          <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>
430
           <script>
430
           <script>
431
             if ($('#ressel').raw().value == "Other") {
431
             if ($('#ressel').raw().value == "Other") {
432
               $('#resolution').raw().readOnly = false
432
               $('#resolution').raw().readOnly = false
443
 <?
443
 <?
444
     foreach($this->AudioFormats as $AudioFormat) {
444
     foreach($this->AudioFormats as $AudioFormat) {
445
       echo "\t\t\t\t\t\t<option value=\"$AudioFormat\"";
445
       echo "\t\t\t\t\t\t<option value=\"$AudioFormat\"";
446
-      if  ($AudioFormat == $Torrent['AudioFormat']) {
446
+      if  ($AudioFormat == ($Torrent['AudioFormat'] ?? false)) {
447
         echo " selected";
447
         echo " selected";
448
       }
448
       }
449
       echo ">$AudioFormat</option>\n";
449
       echo ">$AudioFormat</option>\n";
460
 <?
460
 <?
461
     foreach($this->Languages as $Language) {
461
     foreach($this->Languages as $Language) {
462
       echo "\t\t\t\t\t\t<option value=\"$Language\"";
462
       echo "\t\t\t\t\t\t<option value=\"$Language\"";
463
-      if ($Language == $Torrent['Language']) {
463
+      if ($Language == ($Torrent['Language'] ?? false)) {
464
         echo " selected";
464
         echo " selected";
465
       }
465
       }
466
       echo ">$Language</option>\n";
466
       echo ">$Language</option>\n";
477
 <?
477
 <?
478
     foreach($this->Subbing as $Subbing) {
478
     foreach($this->Subbing as $Subbing) {
479
       echo "\t\t\t\t\t\t<option value=\"$Subbing\"";
479
       echo "\t\t\t\t\t\t<option value=\"$Subbing\"";
480
-      if ($Subbing == $Torrent['Subbing']) {
480
+      if ($Subbing == ($Torrent['Subbing'] ?? false)) {
481
         echo " selected";
481
         echo " selected";
482
       }
482
       }
483
       echo ">$Subbing</option>\n";
483
       echo ">$Subbing</option>\n";
488
       </tr>
488
       </tr>
489
       <tr id="trans_tr">
489
       <tr id="trans_tr">
490
         <td class="label">Translation Group (optional)</td>
490
         <td class="label">Translation Group (optional)</td>
491
-        <td><input type="text" id="subber" name="subber" size="60" value="<?=display_str($Torrent['Subber']) ?>" /></td>
491
+        <td><input type="text" id="subber" name="subber" size="60" value="<?=display_str($Torrent['Subber']??'') ?>" /></td>
492
       </tr>
492
       </tr>
493
       <tr id="censored_tr">
493
       <tr id="censored_tr">
494
         <td class="label">Censored?</td>
494
         <td class="label">Censored?</td>
499
       <tr id="mediainfo_tr">
499
       <tr id="mediainfo_tr">
500
         <td class="label">Media Info</td>
500
         <td class="label">Media Info</td>
501
         <td>
501
         <td>
502
-          <textarea name="mediainfo" id="mediainfo" onchange="MediaInfoExtract()"  rows="8" cols="60"><?=display_str($Torrent['MediaInfo'])?></textarea>
502
+          <textarea name="mediainfo" id="mediainfo" onchange="MediaInfoExtract()"  rows="8" cols="60"><?=display_str($Torrent['MediaInfo']??'')?></textarea>
503
         </td>
503
         </td>
504
       </tr>
504
       </tr>
505
 <?    if ($this->NewTorrent) { ?>
505
 <?    if ($this->NewTorrent) { ?>
553
         <td class="label">Torrent Description (optional)</td>
553
         <td class="label">Torrent Description (optional)</td>
554
         <td>
554
         <td>
555
           <p class="min_padding notes"></p>
555
           <p class="min_padding notes"></p>
556
-<?php new TEXTAREA_PREVIEW('release_desc', 'release_desc', display_str($Torrent['TorrentDescription']), 60, 8); ?>
556
+<?php new TEXTAREA_PREVIEW('release_desc', 'release_desc', display_str($Torrent['TorrentDescription']??''), 60, 8); ?>
557
         </td>
557
         </td>
558
       </tr>
558
       </tr>
559
       <tr id="anon_tr">
559
       <tr id="anon_tr">

Loading…
Cancel
Save