Paste title defaults to 'Untitled'

This commit is contained in:
pikami 2017-04-29 19:16:49 +00:00
parent 7d3230f1d5
commit 9a979592e1
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@
<label for="text">New paste:</label> <label for="text">New paste:</label>
<?php <?php
if($edit_mode == true){ if($edit_mode == true){
printf('<textarea class="form-control" rows="5" id="text" name="text">'.$row['text'].'</textarea>'); echo '<textarea class="form-control" rows="5" id="text" name="text">'.$row['text'].'</textarea>';
} else printf('<textarea class="form-control" rows="5" id="text" name="text"></textarea>'); } else printf('<textarea class="form-control" rows="5" id="text" name="text"></textarea>');
?> ?>
</div> </div>

View File

@ -33,7 +33,7 @@ if(isset($_POST["type"])){
$title = "Untitled"; $title = "Untitled";
$text = $_POST["text"]; $text = $_POST["text"];
$exposure = 0; $exposure = 0;
if(isset($_POST["title"])) if(isset($_POST["title"]) && $_POST["title"]!="")
$title = $_POST["title"]; $title = $_POST["title"];
if(isset($_POST["exposure"]) && is_numeric($_POST["exposure"])) if(isset($_POST["exposure"]) && is_numeric($_POST["exposure"]))
$exposure = $_POST["exposure"]; $exposure = $_POST["exposure"];