fix(webmentions): call to undefined function getMentionsFromTwt()

This commit is contained in:
eapl.mx 2024-12-14 14:34:54 -06:00
parent 97a97122bb
commit d3ce716e9a
No known key found for this signature in database
2 changed files with 30 additions and 38 deletions

View file

@ -1,4 +1,5 @@
<?php
require_once "libs/twtxt.php";
// Send webmentions (TODO: move to it own file?)
$new_mentions = getMentionsFromTwt($twt);

View file

@ -2,7 +2,6 @@
// TODO: Give a warning if the file is not found
$config = parse_ini_file('private/config.ini');
if ($config['debug_mode']) {
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
@ -13,19 +12,13 @@ $txt_file_path = $config['txt_file_path'];
$public_txt_url = $config['public_txt_url'];
$timezone = $config['timezone'];
require_once('libs/session.php');
// if (!has_valid_session()) {
// header('Location: /login.php');
// exit();
// }
require_once 'libs/session.php';
if (!isset($_SESSION['password'])) {
header('Location: ./login');
exit();
}
if (isset($_POST['submit'])) {
$new_post = filter_input(INPUT_POST, 'new_post');
$new_post = trim($new_post);
@ -81,7 +74,7 @@ if (isset($_POST['submit'])) {
// https://www.w3docs.com/snippets/php/how-can-i-handle-the-warning-of-file-get-contents-function-in-php.html
$file_write_result = file_put_contents($txt_file_path, $contents);
// TODO: replace with file_put_contents($logfile, $log, FILE_APPEND) -- https://www.w3schools.com/php/func_filesystem_file_put_contents.asp
// TODO: replace with file_put_contents($logfile, $log, FILE_APPEND) -- https://www.w3schools.com/php/func_filesystem_file_put_contents.asp
// Send webmentions
include_once 'partials/webmentions_send.php';
@ -91,16 +84,15 @@ if (isset($_POST['submit'])) {
//exit;
} else {
require_once("partials/base.php");
require_once "partials/base.php";
$title = "New post - ".$title;
include_once 'partials/header.php';
if (!isset($textareaValue)) {
if (!isset($textareaValue)) {
$textareaValue = '';
}
}
if (isset($_GET['hash'])) {
if (isset($_GET['hash'])) {
$hash = $_GET['hash'];
$textareaValue = "(#$hash) ";
@ -116,8 +108,7 @@ if (isset($_GET['hash'])) {
//$textareaValue .= $twts["nick"];
include_once 'partials/timeline.php';
}
}
?>
<article id="new_twt">