mirror of
https://github.com/friendica/friendica
synced 2025-04-22 16:30:11 +00:00
Line endings are converted to unix style
This commit is contained in:
parent
164f4f7cdf
commit
15a857e411
35 changed files with 1484 additions and 1484 deletions
|
@ -1,60 +1,60 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Module;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Protocol\OStatus;
|
||||
|
||||
/**
|
||||
* Provides public Atom feeds
|
||||
*
|
||||
* Currently supported:
|
||||
* - /feed/[nickname]/ => posts
|
||||
* - /feed/[nickname]/posts => posts
|
||||
* - /feed/[nickname]/comments => comments
|
||||
* - /feed/[nickname]/replies => comments
|
||||
* - /feed/[nickname]/activity => activity
|
||||
*
|
||||
* The nocache GET parameter is provided mainly for debug purposes, requires auth
|
||||
*
|
||||
* @brief Provides public Atom feeds
|
||||
*
|
||||
* @author Hypolite Petovan <mrpetovan@gmail.com>
|
||||
*/
|
||||
class Feed extends BaseModule
|
||||
{
|
||||
public static function content()
|
||||
{
|
||||
$a = self::getApp();
|
||||
|
||||
$last_update = x($_GET, 'last_update') ? $_GET['last_update'] : '';
|
||||
$nocache = x($_GET, 'nocache') && local_user();
|
||||
|
||||
if ($a->argc < 2) {
|
||||
System::httpExit(400);
|
||||
}
|
||||
|
||||
$type = null;
|
||||
if ($a->argc > 2) {
|
||||
$type = $a->argv[2];
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case 'posts':
|
||||
case 'comments':
|
||||
case 'activity':
|
||||
break;
|
||||
case 'replies':
|
||||
$type = 'comments';
|
||||
break;
|
||||
default:
|
||||
$type = 'posts';
|
||||
}
|
||||
|
||||
$nickname = $a->argv[1];
|
||||
header("Content-type: application/atom+xml");
|
||||
echo OStatus::feed($nickname, $last_update, 10, $type, $nocache);
|
||||
killme();
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace Friendica\Module;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Protocol\OStatus;
|
||||
|
||||
/**
|
||||
* Provides public Atom feeds
|
||||
*
|
||||
* Currently supported:
|
||||
* - /feed/[nickname]/ => posts
|
||||
* - /feed/[nickname]/posts => posts
|
||||
* - /feed/[nickname]/comments => comments
|
||||
* - /feed/[nickname]/replies => comments
|
||||
* - /feed/[nickname]/activity => activity
|
||||
*
|
||||
* The nocache GET parameter is provided mainly for debug purposes, requires auth
|
||||
*
|
||||
* @brief Provides public Atom feeds
|
||||
*
|
||||
* @author Hypolite Petovan <mrpetovan@gmail.com>
|
||||
*/
|
||||
class Feed extends BaseModule
|
||||
{
|
||||
public static function content()
|
||||
{
|
||||
$a = self::getApp();
|
||||
|
||||
$last_update = x($_GET, 'last_update') ? $_GET['last_update'] : '';
|
||||
$nocache = x($_GET, 'nocache') && local_user();
|
||||
|
||||
if ($a->argc < 2) {
|
||||
System::httpExit(400);
|
||||
}
|
||||
|
||||
$type = null;
|
||||
if ($a->argc > 2) {
|
||||
$type = $a->argv[2];
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case 'posts':
|
||||
case 'comments':
|
||||
case 'activity':
|
||||
break;
|
||||
case 'replies':
|
||||
$type = 'comments';
|
||||
break;
|
||||
default:
|
||||
$type = 'posts';
|
||||
}
|
||||
|
||||
$nickname = $a->argv[1];
|
||||
header("Content-type: application/atom+xml");
|
||||
echo OStatus::feed($nickname, $last_update, 10, $type, $nocache);
|
||||
killme();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
<?php
|
||||
/**
|
||||
* @file src/Module/Logout.php
|
||||
*/
|
||||
namespace Friendica\Module;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
|
||||
require_once 'boot.php';
|
||||
require_once 'include/security.php';
|
||||
|
||||
/**
|
||||
* Logout module
|
||||
*
|
||||
* @author Hypolite Petovan mrpetovan@gmail.com
|
||||
*/
|
||||
class Logout extends BaseModule
|
||||
{
|
||||
/**
|
||||
* @brief Process logout requests
|
||||
*/
|
||||
public static function init()
|
||||
{
|
||||
Addon::callHooks("logging_out");
|
||||
nuke_session();
|
||||
info(L10n::t('Logged out.') . EOL);
|
||||
goaway(self::getApp()->get_baseurl());
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @file src/Module/Logout.php
|
||||
*/
|
||||
namespace Friendica\Module;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
|
||||
require_once 'boot.php';
|
||||
require_once 'include/security.php';
|
||||
|
||||
/**
|
||||
* Logout module
|
||||
*
|
||||
* @author Hypolite Petovan mrpetovan@gmail.com
|
||||
*/
|
||||
class Logout extends BaseModule
|
||||
{
|
||||
/**
|
||||
* @brief Process logout requests
|
||||
*/
|
||||
public static function init()
|
||||
{
|
||||
Addon::callHooks("logging_out");
|
||||
nuke_session();
|
||||
info(L10n::t('Logged out.') . EOL);
|
||||
goaway(self::getApp()->get_baseurl());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,53 +1,53 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Module;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Content;
|
||||
|
||||
/**
|
||||
* Oembed module
|
||||
*
|
||||
* Displays stored embed content based on a base64 hash of a remote URL
|
||||
*
|
||||
* Example: /oembed/aHR0cHM6Ly9...
|
||||
*
|
||||
* @author Hypolite Petovan <mrpetovan@gmail.com>
|
||||
*/
|
||||
class Oembed extends BaseModule
|
||||
{
|
||||
public static function content()
|
||||
{
|
||||
$a = self::getApp();
|
||||
|
||||
// Unused form: /oembed/b2h?url=...
|
||||
if ($a->argv[1] == 'b2h') {
|
||||
$url = ["", trim(hex2bin($_REQUEST['url']))];
|
||||
echo Content\OEmbed::replaceCallback($url);
|
||||
killme();
|
||||
}
|
||||
|
||||
// Unused form: /oembed/h2b?text=...
|
||||
if ($a->argv[1] == 'h2b') {
|
||||
$text = trim(hex2bin($_REQUEST['text']));
|
||||
echo Content\OEmbed::HTML2BBCode($text);
|
||||
killme();
|
||||
}
|
||||
|
||||
if ($a->argc == 2) {
|
||||
echo '<html><body>';
|
||||
$url = base64url_decode($a->argv[1]);
|
||||
$j = Content\OEmbed::fetchURL($url);
|
||||
|
||||
// workaround for media.ccc.de (and any other endpoint that return size 0)
|
||||
if (substr($j->html, 0, 7) == "<iframe" && strstr($j->html, 'width="0"')) {
|
||||
$j->html = '<style>html,body{margin:0;padding:0;} iframe{width:100%;height:100%;}</style>' . $j->html;
|
||||
$j->html = str_replace('width="0"', '', $j->html);
|
||||
$j->html = str_replace('height="0"', '', $j->html);
|
||||
}
|
||||
echo $j->html;
|
||||
echo '</body></html>';
|
||||
}
|
||||
killme();
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace Friendica\Module;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Content;
|
||||
|
||||
/**
|
||||
* Oembed module
|
||||
*
|
||||
* Displays stored embed content based on a base64 hash of a remote URL
|
||||
*
|
||||
* Example: /oembed/aHR0cHM6Ly9...
|
||||
*
|
||||
* @author Hypolite Petovan <mrpetovan@gmail.com>
|
||||
*/
|
||||
class Oembed extends BaseModule
|
||||
{
|
||||
public static function content()
|
||||
{
|
||||
$a = self::getApp();
|
||||
|
||||
// Unused form: /oembed/b2h?url=...
|
||||
if ($a->argv[1] == 'b2h') {
|
||||
$url = ["", trim(hex2bin($_REQUEST['url']))];
|
||||
echo Content\OEmbed::replaceCallback($url);
|
||||
killme();
|
||||
}
|
||||
|
||||
// Unused form: /oembed/h2b?text=...
|
||||
if ($a->argv[1] == 'h2b') {
|
||||
$text = trim(hex2bin($_REQUEST['text']));
|
||||
echo Content\OEmbed::HTML2BBCode($text);
|
||||
killme();
|
||||
}
|
||||
|
||||
if ($a->argc == 2) {
|
||||
echo '<html><body>';
|
||||
$url = base64url_decode($a->argv[1]);
|
||||
$j = Content\OEmbed::fetchURL($url);
|
||||
|
||||
// workaround for media.ccc.de (and any other endpoint that return size 0)
|
||||
if (substr($j->html, 0, 7) == "<iframe" && strstr($j->html, 'width="0"')) {
|
||||
$j->html = '<style>html,body{margin:0;padding:0;} iframe{width:100%;height:100%;}</style>' . $j->html;
|
||||
$j->html = str_replace('width="0"', '', $j->html);
|
||||
$j->html = str_replace('height="0"', '', $j->html);
|
||||
}
|
||||
echo $j->html;
|
||||
echo '</body></html>';
|
||||
}
|
||||
killme();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue