affichage du lien complet lors de l'ajout du partage'

This commit is contained in:
max/sooulix 2025-02-11 10:43:00 +01:00
parent 20a52c8128
commit 7b8574e986
3 changed files with 9 additions and 2 deletions

View File

@ -43,5 +43,5 @@ $new_share = [
"expiration" => $_POST['expiration'],
"expires" => current_date_offset($_POST['expiration'])
];
$new_share["link"] = "./read.php?id=" . gen_identifier($new_share);
$new_share["link"] = "read.php?id=" . gen_identifier($new_share);
?>

View File

@ -211,6 +211,13 @@ function error_code($int)
exit();
}
function absolute_link($relpath)
{
$scheme = isset($_SERVER['HTTPS']) ? 'https://' : 'http://';
$base_uri = $_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']);
return $scheme . $base_uri . $relpath;
}
function _($var)
{
print($var);

View File

@ -1,4 +1,4 @@
Share "<?php _($new_share["dir"]) ?> with following link : <a href="<?php _($new_share["link"]) ?>"><?php _($new_share["link"]) ?></a>
Share "<?php _($new_share["dir"]) ?> with following link : <a href="./<?php _($new_share["link"]) ?>"><?php _(absolute_link($new_share["link"])) ?></a>
</br>