X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=util%2Ffpostit%2Ffpostit.php;h=3a2f0d15f54192fa74b92f8d6ea0caa0be3c0f99;hb=f2ca3e5be44192c486e8e3af2a993e065ad40a7d;hp=491d81f6d6ffd38cf7ce28bac16785017e02e51d;hpb=1d5f1723e0a9100783f3999c49c1d60c4ad69541;p=friendica.git
diff --git a/util/fpostit/fpostit.php b/util/fpostit/fpostit.php
index 491d81f6d6..3a2f0d15f5 100644
--- a/util/fpostit/fpostit.php
+++ b/util/fpostit/fpostit.php
@@ -1,8 +1,8 @@
@@ -58,44 +58,44 @@ if ((isset($title)) && (isset($text)) && (isset($url))) {
}
if (isset($_POST['submit'])) {
-
- if (($_POST["friendika_acct_name"] != '') && ($_POST["friendika_password"] != '')) {
- $acctname = $_POST["friendika_acct_name"];
+
+ if (($_POST["friendica_acct_name"] != '') && ($_POST["friendica_password"] != '')) {
+ $acctname = $_POST["friendica_acct_name"];
$tmp_account_array = explode("@", $acctname);
if (isset($tmp_account_array[1])) {
$username = $tmp_account_array[0];
$hostname = $tmp_account_array[1];
}
- $password = $_POST["friendika_password"];
+ $password = $_POST["friendica_password"];
$content = $_POST["content"];
$url = "http://" . $hostname . '/api/statuses/update';
- $data = array('status' => $content);
-
+ $data = ['status' => $content];
+
// echo "posting to: $url
";
$c = curl_init();
- curl_setopt($c, CURLOPT_URL, $url);
+ curl_setopt($c, CURLOPT_URL, $url);
curl_setopt($c, CURLOPT_USERPWD, "$username:$password");
- curl_setopt($c, CURLOPT_POSTFIELDS, $data);
- curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($c, CURLOPT_POSTFIELDS, $data);
+ curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_setopt($c, CURLOPT_FOLLOWLOCATION, true);
- $c_result = curl_exec($c);
- if(curl_errno($c)){
+ $c_result = curl_exec($c);
+ if(curl_errno($c)){
$error = curl_error($c);
showForm($error, $content);
}
-
+
curl_close($c);
if (!isset($error)) {
echo '';
}
-
+
} else {
$error = "Missing account name and/or password...try again please";
showForm($error, $content);
}
-
+
} else {
showForm(null, $content);
}
@@ -103,25 +103,25 @@ if (isset($_POST['submit'])) {
function showForm($error, $content) {
$username_cookie = $_COOKIE['username'];
$password_cookie = $_COOKIE['password'];
-
+
echo <<
-
- Friendika Bookmarklet
+
+ Friendica Bookmarklet
EOF;
-
+
}
?>