Add isset check before calling folder_id from GET params

This commit is contained in:
Marcus Hill
2023-01-26 12:15:35 +00:00
parent 5edd37a46e
commit 5d9930ad28
2 changed files with 10 additions and 10 deletions

View File

@@ -28,13 +28,13 @@
?> ?>
<option value="<?php echo $document_template_id ?>"><?php echo $document_template_name; ?></option> <option value="<?php echo $document_template_id ?>"><?php echo $document_template_name; ?></option>
<?php <?php
} }
?> ?>
</select> </select>
</div> </div>
</div> </div>
<label>Document name</label> <label>Document name</label>
<div class="form-group"> <div class="form-group">
<div class="input-group"> <div class="input-group">
@@ -60,17 +60,17 @@
$folder_name = htmlentities($row['folder_name']); $folder_name = htmlentities($row['folder_name']);
?> ?>
<option <?php if ($_GET['folder_id'] == $folder_id) echo "selected"; ?> value="<?php echo $folder_id ?>"><?php echo $folder_name; ?></option> <option <?php if (isset($_GET['folder_id']) && $_GET['folder_id'] == $folder_id) echo "selected"; ?> value="<?php echo $folder_id ?>"><?php echo $folder_name; ?></option>
<?php <?php
} }
?> ?>
</select> </select>
</div> </div>
</div> </div>
</div> </div>
<div class="modal-footer bg-white"> <div class="modal-footer bg-white">
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button> <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">Cancel</button>
@@ -80,4 +80,4 @@
</form> </form>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -33,7 +33,7 @@
$folder_name = htmlentities($row['folder_name']); $folder_name = htmlentities($row['folder_name']);
?> ?>
<option <?php if ($_GET['folder_id'] == $folder_id) echo "selected"; ?> value="<?php echo $folder_id ?>"><?php echo $folder_name; ?></option> <option <?php if (isset($_GET['folder_id']) && $_GET['folder_id'] == $folder_id) echo "selected"; ?> value="<?php echo $folder_id ?>"><?php echo $folder_name; ?></option>
<?php <?php
} }
?> ?>