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>
<?php
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>');
?>
</div>

View File

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