aboutsummaryrefslogtreecommitdiff
path: root/lib/functions.php
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2023-09-02 00:18:55 -0600
committerIván Ávalos <avalos@disroot.org>2023-09-02 00:41:00 -0600
commitaa1bac9aa30c6ba8ff48c8b70dfc523e3197e315 (patch)
treebe33e8c6dd22e1eb62a02488c0a305f11fcbfa75 /lib/functions.php
parent706c4cc1fa62492344089a3310c7bcea1041f78b (diff)
downloadmicroblog-aa1bac9aa30c6ba8ff48c8b70dfc523e3197e315.tar.gz
microblog-aa1bac9aa30c6ba8ff48c8b70dfc523e3197e315.tar.bz2
microblog-aa1bac9aa30c6ba8ff48c8b70dfc523e3197e315.zip
Remove ActivityPub and Twitter support, and fix localhost
Diffstat (limited to 'lib/functions.php')
-rw-r--r--lib/functions.php24
1 files changed, 1 insertions, 23 deletions
diff --git a/lib/functions.php b/lib/functions.php
index 6fe13d8..608d473 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -12,7 +12,7 @@ function check_login() {
if(isset($_COOKIE['microblog_login'])) {
if($_COOKIE['microblog_login'] === sha1($config['url'].$config['admin_pass'])) {
// correct auth data, extend cookie life
- $domain = ($_SERVER['HTTP_HOST'] != 'localhost') ? $_SERVER['HTTP_HOST'] : false;
+ $domain = ($_SERVER['SERVER_NAME'] != 'localhost') ? $_SERVER['HTTP_HOST'] : false;
setcookie('microblog_login', sha1($config['url'].$config['admin_pass']), NOW+$config['cookie_life'], '/', $domain, false);
return true;
@@ -607,25 +607,3 @@ function uuidv4($data = null) { // https://stackoverflow.com/a/15875555/3625228
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
}
-
-function twitter_post_status($status='') {
- global $config;
- require_once(ROOT.DS.'lib'.DS.'twitter_api.php');
-
- if(empty($status)) return array('errors' => 1);
- if(empty($config['twitter']['oauth_access_token']) ||
- empty($config['twitter']['oauth_access_token_secret']) ||
- empty($config['twitter']['consumer_key']) ||
- empty($config['twitter']['consumer_secret'])) return array('errors' => 2);
-
- $url = 'https://api.twitter.com/1.1/statuses/update.json';
- $postfields = array(
- 'status' => $status,
- 'trim_user' => 1
- );
-
- $twitter = new TwitterAPIExchange($config['twitter']);
- return $twitter->buildOauth($url, 'POST')->setPostfields($postfields)->performRequest();
-}
-
-require_once(__DIR__.DS.'activitypub-functions.php');