コミットを比較
4 コミット
e8e27ca83e
...
ccfa0c90ae
作成者 | SHA1 | 日付 |
---|---|---|
守矢諏訪子 | ccfa0c90ae | |
守矢諏訪子 | 2de5e45fbb | |
守矢諏訪子 | 2a12f11164 | |
守矢諏訪子 | f515e007ee |
|
@ -52,7 +52,6 @@ defined('GNUSOCIAL') || die();
|
|||
class ApiTimelineUserAction extends ApiBareAuthAction
|
||||
{
|
||||
public $notices = null;
|
||||
|
||||
public $next_id = null;
|
||||
|
||||
/**
|
||||
|
|
|
@ -45,6 +45,9 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
|||
*/
|
||||
class CancelgroupAction extends Action
|
||||
{
|
||||
public $profile;
|
||||
public $request;
|
||||
|
||||
var $group = null;
|
||||
|
||||
/**
|
||||
|
|
|
@ -39,9 +39,7 @@ class DeletenoticeAction extends FormAction
|
|||
{
|
||||
$this->notice = Notice::getByID($this->trimmed('notice'));
|
||||
|
||||
if ($this->notice->isVerb([ActivityVerb::DELETE]) ||
|
||||
(!$this->scoped->sameAs($this->notice->getProfile()) &&
|
||||
!$this->scoped->hasRight(Right::DELETEOTHERSNOTICE))) {
|
||||
if ($this->isAuthorizedToDelete($this->notice)) {
|
||||
// TRANS: Error message displayed when trying to delete a notice that was not made by the current user.
|
||||
$this->clientError(_('Cannot delete this notice.'));
|
||||
}
|
||||
|
@ -49,14 +47,21 @@ class DeletenoticeAction extends FormAction
|
|||
$this->formOpts['notice'] = $this->notice;
|
||||
}
|
||||
|
||||
function getInstructions()
|
||||
protected function isAuthorizedToDelete(Notice $notice): bool
|
||||
{
|
||||
return $notice->isVerb([ActivityVerb::DELETE]) ||
|
||||
(!$this->scoped->sameAs($notice->getProfile()) &&
|
||||
!$this->scoped->hasRight(Right::DELETEOTHERSNOTICE));
|
||||
}
|
||||
|
||||
function getInstructions(): string
|
||||
{
|
||||
// TRANS: Instructions for deleting a notice.
|
||||
return _('You are about to permanently delete a notice. ' .
|
||||
'Once this is done, it cannot be undone.');
|
||||
}
|
||||
|
||||
function title()
|
||||
function title(): string
|
||||
{
|
||||
// TRANS: Page title when deleting a notice.
|
||||
return _('Delete notice');
|
||||
|
@ -65,9 +70,9 @@ class DeletenoticeAction extends FormAction
|
|||
protected function doPost()
|
||||
{
|
||||
if ($this->arg('yes')) {
|
||||
if (Event::handle('StartDeleteOwnNotice', array($this->scoped->getUser(), $this->notice))) {
|
||||
if (Event::handle('StartDeleteOwnNotice', [$this->scoped->getUser(), $this->notice])) {
|
||||
$this->notice->deleteAs($this->scoped);
|
||||
Event::handle('EndDeleteOwnNotice', array($this->scoped->getUser(), $this->notice));
|
||||
Event::handle('EndDeleteOwnNotice', [$this->scoped->getUser(), $this->notice]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,9 +40,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
*/
|
||||
class DeleteuserAction extends ProfileFormAction
|
||||
{
|
||||
var $user = null;
|
||||
protected $user = null;
|
||||
|
||||
function prepare(array $args=array())
|
||||
public function prepare(array $args = []): bool
|
||||
{
|
||||
if (!parent::prepare($args)) {
|
||||
return false;
|
||||
|
@ -85,27 +85,32 @@ class DeleteuserAction extends ProfileFormAction
|
|||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
if ($this->arg('no')) {
|
||||
$this->returnToPrevious();
|
||||
} elseif ($this->arg('yes')) {
|
||||
return;
|
||||
}
|
||||
if ($this->arg('yes')) {
|
||||
$this->handlePost();
|
||||
$this->returnToPrevious();
|
||||
} else {
|
||||
$this->showPage();
|
||||
return;
|
||||
}
|
||||
$this->showPage();
|
||||
}
|
||||
}
|
||||
|
||||
function showContent() {
|
||||
public function showContent(): void
|
||||
{
|
||||
$this->areYouSureForm();
|
||||
$block = new AccountProfileBlock($this, $this->profile);
|
||||
$block->show();
|
||||
}
|
||||
|
||||
function title() {
|
||||
public function title(): string
|
||||
{
|
||||
// TRANS: Title of delete user page.
|
||||
return _m('TITLE','Delete user');
|
||||
}
|
||||
|
||||
function showNoticeForm() {
|
||||
function showNoticeForm(): void
|
||||
{
|
||||
// nop
|
||||
}
|
||||
|
||||
|
@ -116,7 +121,7 @@ class DeleteuserAction extends ProfileFormAction
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function areYouSureForm()
|
||||
function areYouSureForm(): void
|
||||
{
|
||||
$id = $this->profile->id;
|
||||
$this->elementStart('form', array('id' => 'deleteuser-' . $id,
|
||||
|
@ -167,7 +172,7 @@ class DeleteuserAction extends ProfileFormAction
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
function handlePost()
|
||||
function handlePost(): void
|
||||
{
|
||||
if (Event::handle('StartDeleteUser', array($this, $this->user))) {
|
||||
// Mark the account as deleted and shove low-level deletion tasks
|
||||
|
|
|
@ -42,6 +42,8 @@ if (!defined('STATUSNET')) {
|
|||
*/
|
||||
class GrantRoleAction extends ProfileFormAction
|
||||
{
|
||||
public $role;
|
||||
|
||||
/**
|
||||
* Check parameters
|
||||
*
|
||||
|
|
|
@ -48,6 +48,7 @@ if (!defined('GNUSOCIAL')) {
|
|||
*/
|
||||
class GrouplogoAction extends GroupAction
|
||||
{
|
||||
public $filedata;
|
||||
public $mode = null;
|
||||
public $imagefile = null;
|
||||
public $filename = null;
|
||||
|
|
|
@ -41,6 +41,8 @@ defined('GNUSOCIAL') || die();
|
|||
*/
|
||||
class NewnoticeAction extends FormAction
|
||||
{
|
||||
public $stored;
|
||||
|
||||
protected $form = 'Notice';
|
||||
|
||||
protected $inreplyto = null;
|
||||
|
|
|
@ -48,6 +48,8 @@ require_once INSTALLDIR . '/lib/search/searchaction.php';
|
|||
*/
|
||||
class NoticesearchAction extends SearchAction
|
||||
{
|
||||
public $notice;
|
||||
|
||||
protected $q = null;
|
||||
|
||||
function prepare(array $args = array())
|
||||
|
@ -181,7 +183,9 @@ class NoticesearchAction extends SearchAction
|
|||
}
|
||||
|
||||
class SearchNoticeList extends NoticeList {
|
||||
function __construct($notice, $out=null, $terms)
|
||||
public $terms;
|
||||
|
||||
function __construct($notice, $out=null, $terms=null)
|
||||
{
|
||||
parent::__construct($notice, $out);
|
||||
$this->terms = $terms;
|
||||
|
@ -194,7 +198,9 @@ class SearchNoticeList extends NoticeList {
|
|||
}
|
||||
|
||||
class SearchNoticeListItem extends NoticeListItem {
|
||||
function __construct($notice, $out=null, $terms)
|
||||
public $terms;
|
||||
|
||||
function __construct($notice, $out=null, $terms=null)
|
||||
{
|
||||
parent::__construct($notice, $out);
|
||||
$this->terms = $terms;
|
||||
|
|
|
@ -163,13 +163,12 @@ class RegisterAction extends Action
|
|||
$token = $this->trimmed('token');
|
||||
if (!$token || $token != common_session_token()) {
|
||||
// TRANS: Client error displayed when the session token does not match or is not given.
|
||||
$this->showForm(_('There was a problem with your session token. '.
|
||||
'Try again, please.'));
|
||||
$this->showForm(_('There was a problem with your session token. Try again, please.'));
|
||||
return;
|
||||
}
|
||||
|
||||
$nickname = $this->trimmed('nickname');
|
||||
$email = $this->trimmed('email');
|
||||
$email = common_canonical_email($this->trimmed('email'));
|
||||
$fullname = $this->trimmed('fullname');
|
||||
$homepage = $this->trimmed('homepage');
|
||||
$bio = $this->trimmed('bio');
|
||||
|
@ -198,52 +197,54 @@ class RegisterAction extends Action
|
|||
$this->showForm($e->getMessage());
|
||||
return;
|
||||
}
|
||||
$email = common_canonical_email($email);
|
||||
|
||||
if (!$this->boolean('license')) {
|
||||
// TRANS: Form validation error displayed when trying to register without agreeing to the site license.
|
||||
$this->showForm(_('You cannot register if you do not '.
|
||||
'agree to the license.'));
|
||||
$this->showForm(_('You cannot register if you do not agree to the license.'));
|
||||
} else if ($email && !Validate::email($email, common_config('email', 'check_domain'))) {
|
||||
// TRANS: Form validation error displayed when trying to register without a valid e-mail address.
|
||||
$this->showForm(_('Not a valid email address.'));
|
||||
} else if ($this->emailExists($email)) {
|
||||
// TRANS: Form validation error displayed when trying to register with an already registered e-mail address.
|
||||
$this->showForm(_('Email address already exists.'));
|
||||
} else if (!is_null($homepage) && (strlen($homepage) > 0) &&
|
||||
!common_valid_http_url($homepage)) {
|
||||
} else if (!is_null($homepage) && (strlen($homepage) > 0) && !common_valid_http_url($homepage)) {
|
||||
// TRANS: Form validation error displayed when trying to register with an invalid homepage URL.
|
||||
$this->showForm(_('Homepage is not a valid URL.'));
|
||||
} else if (Profile::bioTooLong($bio)) {
|
||||
// TRANS: Form validation error on registration page when providing too long a bio text.
|
||||
// TRANS: %d is the maximum number of characters for bio; used for plural.
|
||||
$this->showForm(sprintf(_m('Bio is too long (maximum %d character).',
|
||||
'Bio is too long (maximum %d characters).',
|
||||
Profile::maxBio()),
|
||||
Profile::maxBio()));
|
||||
} else if (strlen($password) < 6) {
|
||||
// TRANS: Form validation error displayed when trying to register with too short a password.
|
||||
$this->showForm(_('Password must be 6 or more characters.'));
|
||||
} else if ($password != $confirm) {
|
||||
// TRANS: Form validation error displayed when trying to register with non-matching passwords.
|
||||
$this->showForm(_('Passwords do not match.'));
|
||||
'Bio is too long (maximum %d characters).',
|
||||
Profile::maxBio()),
|
||||
Profile::maxBio()));
|
||||
} else if (strlen($password) < 6) {
|
||||
// TRANS: Form validation error displayed when trying to register with too short a password.
|
||||
$this->showForm(_('Password must be 6 or more characters.'));
|
||||
} else if ($password != $confirm) {
|
||||
// TRANS: Form validation error displayed when trying to register with non-matching passwords.
|
||||
$this->showForm(_('Passwords do not match.'));
|
||||
} else {
|
||||
try {
|
||||
$user = User::register(array('nickname' => $nickname,
|
||||
'password' => $password,
|
||||
'email' => $email,
|
||||
'fullname' => $fullname,
|
||||
'homepage' => $homepage,
|
||||
'bio' => $bio,
|
||||
'location' => $location,
|
||||
'code' => $code));
|
||||
$user = User::register([
|
||||
'nickname' => $nickname,
|
||||
'password' => $password,
|
||||
'email' => $email,
|
||||
'fullname' => $this->trimmed('fullname'),
|
||||
'homepage' => $this->trimmed('homepage'),
|
||||
'bio' => $this->trimmed('bio'),
|
||||
'location' => $this->trimmed('location'),
|
||||
'code' => $code
|
||||
]);
|
||||
|
||||
// success!
|
||||
if (!common_set_user($user)) {
|
||||
// TRANS: Server error displayed when saving fails during user registration.
|
||||
$this->serverError(_('Error setting user.'));
|
||||
}
|
||||
|
||||
// this is a real login
|
||||
common_real_login(true);
|
||||
|
||||
if ($this->boolean('rememberme')) {
|
||||
common_debug('Adding rememberme cookie for ' . $nickname);
|
||||
common_rememberme($user);
|
||||
|
@ -251,9 +252,7 @@ class RegisterAction extends Action
|
|||
|
||||
// Re-init language env in case it changed (not yet, but soon)
|
||||
common_init_language();
|
||||
|
||||
Event::handle('EndRegistrationTry', array($this));
|
||||
|
||||
Event::handle('EndRegistrationTry', [$this]);
|
||||
$this->showSuccess();
|
||||
} catch (Exception $e) {
|
||||
// TRANS: Form validation error displayed when trying to register with an invalid username or password.
|
||||
|
|
|
@ -42,6 +42,8 @@ if (!defined('STATUSNET')) {
|
|||
*/
|
||||
class RevokeRoleAction extends ProfileFormAction
|
||||
{
|
||||
public $role;
|
||||
|
||||
/**
|
||||
* Check parameters
|
||||
*
|
||||
|
|
|
@ -44,6 +44,9 @@ require_once INSTALLDIR . '/lib/notices/noticelist.php';
|
|||
*/
|
||||
class ShownoticeAction extends ManagedAction
|
||||
{
|
||||
public $target;
|
||||
public $user;
|
||||
|
||||
protected $redirectAfterLogin = true;
|
||||
|
||||
/**
|
||||
|
|
|
@ -31,6 +31,7 @@ defined('GNUSOCIAL') || die();
|
|||
class File extends Managed_DataObject
|
||||
{
|
||||
public $is_mariadb;
|
||||
public $total;
|
||||
|
||||
public $__table = 'file'; // table name
|
||||
public $id; // int(4) primary_key not_null
|
||||
|
@ -426,7 +427,7 @@ class File extends Managed_DataObject
|
|||
*/
|
||||
public static function validFilename($filename)
|
||||
{
|
||||
return preg_match('/^[A-Za-z0-9._-]+$/', $filename);
|
||||
return preg_match('/^[A-Za-z0-9._-]+$/', $filename ?? "");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -100,7 +100,7 @@ class File_thumbnail extends Managed_DataObject
|
|||
$file = File::getById($file->getID());
|
||||
}
|
||||
|
||||
if (file_exists($imgPath)) {
|
||||
if (file_exists($imgPath ?? "")) {
|
||||
$image = new ImageFile($imgPath, $file->getID(), null, $file->getUrl(false));
|
||||
} else {
|
||||
try {
|
||||
|
|
|
@ -802,25 +802,26 @@ class Notice extends Managed_DataObject
|
|||
|
||||
// Get ActivityObject properties
|
||||
$actobj = null;
|
||||
if (!empty($act->id)) {
|
||||
if ($act->id !== null) {
|
||||
// implied object
|
||||
$options['uri'] = $act->id;
|
||||
$options['url'] = $act->link;
|
||||
$options['uri'] = $act->id ?? "";
|
||||
$options['url'] = $act->link ?? "";
|
||||
if ($act->selfLink) {
|
||||
$options['self'] = $act->selfLink;
|
||||
}
|
||||
} else {
|
||||
$actobj = count($act->objects)===1 ? $act->objects[0] : null;
|
||||
if (!is_null($actobj) && !empty($actobj->id)) {
|
||||
$options['uri'] = $actobj->id;
|
||||
if ($actobj->link) {
|
||||
$options['url'] = $actobj->link;
|
||||
} elseif (preg_match('!^https?://!', $actobj->id)) {
|
||||
$options['url'] = $actobj->id;
|
||||
$actobj = count($act->objects) === 1 ? $act->objects[0] : null;
|
||||
if ($actobj !== null && !empty($actobj->id)) {
|
||||
$options['uri'] = $actobj->id ?? "";
|
||||
if ($actobj->link !== null) {
|
||||
$options['url'] = $actobj->link ?? "";
|
||||
} elseif (preg_match('!^https?://!', $actobj->id ?? "")) {
|
||||
$options['url'] = $actobj->id ?? "";
|
||||
}
|
||||
}
|
||||
|
||||
if ($actobj->selfLink) {
|
||||
$options['self'] = $actobj->selfLink;
|
||||
$options['self'] = $actobj->selfLink ?? "";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -887,9 +888,9 @@ class Notice extends Managed_DataObject
|
|||
$stored->verb = $act->verb;
|
||||
|
||||
// we use mb_strlen because it _might_ be that the content is just the string "0"...
|
||||
$content = ($act->content !== null && mb_strlen($act->content)) ? $act->content : $act->summary;
|
||||
if ($content !== null) {
|
||||
throw new ClientException(_('投稿はNULLです。'));
|
||||
$content = $act->content ?? $act->summary;
|
||||
if (mb_strlen($content ?? "") === 0 && $actobj !== null) {
|
||||
$content = $actobj->content ?? $actobj->summary;
|
||||
}
|
||||
|
||||
if (($actobj !== null && $actobj->content !== null && mb_strlen($actobj->content)) === 0) {
|
||||
|
|
|
@ -26,6 +26,31 @@ defined('GNUSOCIAL') || die();
|
|||
class Profile extends Managed_DataObject
|
||||
{
|
||||
public $is_mariadb;
|
||||
public $group_id;
|
||||
public $profile_id;
|
||||
public $is_admin;
|
||||
public $uri;
|
||||
protected $password;
|
||||
protected $email;
|
||||
protected $incomingemail;
|
||||
protected $emailnotifysub;
|
||||
protected $emailnotifyfav;
|
||||
protected $emailnotifynudge;
|
||||
protected $emailnotifymsg;
|
||||
protected $emailnotifyattn;
|
||||
protected $language;
|
||||
protected $timezone;
|
||||
protected $emailpost;
|
||||
protected $sms;
|
||||
protected $carrier;
|
||||
protected $smsnotify;
|
||||
protected $smsreplies;
|
||||
protected $smsemail;
|
||||
protected $autosubscribe;
|
||||
protected $subscribe_policy;
|
||||
protected $urlshorteningservice;
|
||||
protected $private_stream;
|
||||
|
||||
public $__table = 'profile'; // table name
|
||||
public $id; // int(4) primary_key not_null
|
||||
public $nickname; // varchar(64) multiple_key not_null
|
||||
|
@ -240,7 +265,7 @@ class Profile extends Managed_DataObject
|
|||
}
|
||||
}
|
||||
|
||||
if (mb_strlen($this->getFullname()) > 0) {
|
||||
if (mb_strlen($this->getFullname() ?? "") > 0) {
|
||||
// TRANS: The "fancy name": Full name of a profile or group (%1$s) followed by some URI (%2$s) in parentheses.
|
||||
return sprintf(_m('FANCYNAME', '%1$s (%2$s)'), $this->getFullname(), $uri);
|
||||
} else {
|
||||
|
|
|
@ -26,6 +26,8 @@ defined('GNUSOCIAL') || die();
|
|||
|
||||
class Profile_list extends Managed_DataObject
|
||||
{
|
||||
public $cursor;
|
||||
|
||||
public $__table = 'profile_list'; // table name
|
||||
public $id; // int(4) primary_key not_null
|
||||
public $tagger; // int(4)
|
||||
|
@ -897,7 +899,7 @@ class Profile_list extends Managed_DataObject
|
|||
$tags = array();
|
||||
|
||||
foreach ($keys as $key) {
|
||||
$t = Profile_list::getByTaggerAndTag($key[0], $key[1]);
|
||||
$t = Profile_list::getByTaggerAndTag($key[0] ?? "", $key[1] ?? "");
|
||||
if (!empty($t)) {
|
||||
$tags[] = $t;
|
||||
}
|
||||
|
@ -912,7 +914,7 @@ class Profile_list extends Managed_DataObject
|
|||
|
||||
$pairs = array();
|
||||
foreach ($keys as $key) {
|
||||
$pairs[] = '(' . $key[0] . ', "' . $key[1] . '")';
|
||||
$pairs[] = '(' . $key[0] ?? "" . ', "' . $key[1] ?? "" . '")';
|
||||
}
|
||||
|
||||
$tag->whereAdd('(tagger, tag) in (' . implode(', ', $pairs) . ')');
|
||||
|
@ -928,7 +930,7 @@ class Profile_list extends Managed_DataObject
|
|||
$wrapped = array();
|
||||
|
||||
foreach ($keys as $key) {
|
||||
$id = $key[0].'-'.$key[1];
|
||||
$id = $key[0] ?? "".'-'.$key[1] ?? "";
|
||||
if (array_key_exists($id, $temp)) {
|
||||
$wrapped[] = $temp[$id];
|
||||
}
|
||||
|
|
|
@ -37,19 +37,19 @@ class Queue_item extends Managed_DataObject
|
|||
|
||||
public static function schemaDef()
|
||||
{
|
||||
return array(
|
||||
'fields' => array(
|
||||
'id' => array('type' => 'serial', 'not null' => true, 'description' => 'unique identifier'),
|
||||
'frame' => array('type' => 'blob', 'not null' => true, 'description' => 'data: object reference or opaque string'),
|
||||
'transport' => array('type' => 'varchar', 'length' => 32, 'not null' => true, 'description' => 'queue for what? "email", "xmpp", "sms", "irc", ...'),
|
||||
'created' => array('type' => 'datetime', 'description' => 'date this record was created'),
|
||||
'claimed' => array('type' => 'datetime', 'description' => 'date this item was claimed'),
|
||||
),
|
||||
'primary key' => array('id'),
|
||||
'indexes' => array(
|
||||
'queue_item_created_id_idx' => array('created', 'id'),
|
||||
),
|
||||
);
|
||||
return [
|
||||
'fields' => [
|
||||
'id' => ['type' => 'serial', 'not null' => true, 'description' => 'unique identifier'],
|
||||
'frame' => ['type' => 'blob', 'not null' => true, 'description' => 'data: object reference or opaque string'],
|
||||
'transport' => ['type' => 'varchar', 'length' => 32, 'not null' => true, 'description' => 'queue for what? "email", "xmpp", "sms", "irc", ...'],
|
||||
'created' => ['type' => 'datetime', 'description' => 'date this record was created'],
|
||||
'claimed' => ['type' => 'datetime', 'description' => 'date this item was claimed'],
|
||||
],
|
||||
'primary key' => ['id'],
|
||||
'indexes' => [
|
||||
'queue_item_created_id_idx' => ['created', 'id'],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
124
classes/User.php
124
classes/User.php
|
@ -22,6 +22,8 @@ defined('GNUSOCIAL') || die();
|
|||
|
||||
class User extends Managed_DataObject
|
||||
{
|
||||
public $is_mariadb;
|
||||
|
||||
const SUBSCRIBE_POLICY_OPEN = 0;
|
||||
const SUBSCRIBE_POLICY_MODERATE = 1;
|
||||
|
||||
|
@ -60,63 +62,63 @@ class User extends Managed_DataObject
|
|||
|
||||
public static function schemaDef()
|
||||
{
|
||||
return array(
|
||||
return [
|
||||
'description' => 'local users',
|
||||
'fields' => array(
|
||||
'id' => array('type' => 'int', 'not null' => true, 'description' => 'foreign key to profile table'),
|
||||
'nickname' => array('type' => 'varchar', 'length' => 64, 'description' => 'nickname or username, duped in profile'),
|
||||
'password' => array('type' => 'text', 'description' => 'salted password, can be null for OpenID users'),
|
||||
'email' => array('type' => 'varchar', 'length' => 191, 'description' => 'email address for password recovery etc.'),
|
||||
'incomingemail' => array('type' => 'varchar', 'length' => 191, 'description' => 'email address for post-by-email'),
|
||||
'emailnotifysub' => array('type' => 'bool', 'default' => true, 'description' => 'Notify by email of subscriptions'),
|
||||
'emailnotifyfav' => array('type' => 'int', 'size' => 'tiny', 'default' => null, 'description' => 'Notify by email of favorites'),
|
||||
'emailnotifynudge' => array('type' => 'bool', 'default' => true, 'description' => 'Notify by email of nudges'),
|
||||
'emailnotifymsg' => array('type' => 'bool', 'default' => true, 'description' => 'Notify by email of direct messages'),
|
||||
'emailnotifyattn' => array('type' => 'bool', 'default' => true, 'description' => 'Notify by email of @-replies'),
|
||||
'language' => array('type' => 'varchar', 'length' => 50, 'description' => 'preferred language'),
|
||||
'timezone' => array('type' => 'varchar', 'length' => 50, 'description' => 'timezone'),
|
||||
'emailpost' => array('type' => 'bool', 'default' => true, 'description' => 'Post by email'),
|
||||
'sms' => array('type' => 'varchar', 'length' => 64, 'description' => 'sms phone number'),
|
||||
'carrier' => array('type' => 'int', 'description' => 'foreign key to sms_carrier'),
|
||||
'smsnotify' => array('type' => 'bool', 'default' => false, 'description' => 'whether to send notices to SMS'),
|
||||
'smsreplies' => array('type' => 'bool', 'default' => false, 'description' => 'whether to send notices to SMS on replies'),
|
||||
'smsemail' => array('type' => 'varchar', 'length' => 191, 'description' => 'built from sms and carrier'),
|
||||
'uri' => array('type' => 'varchar', 'length' => 191, 'description' => 'universally unique identifier, usually a tag URI'),
|
||||
'autosubscribe' => array('type' => 'bool', 'default' => false, 'description' => 'automatically subscribe to users who subscribe to us'),
|
||||
'subscribe_policy' => array('type' => 'int', 'size' => 'tiny', 'default' => 0, 'description' => '0 = anybody can subscribe; 1 = require approval'),
|
||||
'urlshorteningservice' => array('type' => 'varchar', 'length' => 50, 'default' => 'internal', 'description' => 'service to use for auto-shortening URLs'),
|
||||
'private_stream' => array('type' => 'bool', 'default' => false, 'description' => 'whether to limit all notices to followers only'),
|
||||
'created' => array('type' => 'datetime', 'description' => 'date this record was created'),
|
||||
'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
|
||||
),
|
||||
'primary key' => array('id'),
|
||||
'unique keys' => array(
|
||||
'user_nickname_key' => array('nickname'),
|
||||
'user_email_key' => array('email'),
|
||||
'user_incomingemail_key' => array('incomingemail'),
|
||||
'user_sms_key' => array('sms'),
|
||||
'user_uri_key' => array('uri'),
|
||||
),
|
||||
'foreign keys' => array(
|
||||
'user_id_fkey' => array('profile', array('id' => 'id')),
|
||||
'user_carrier_fkey' => array('sms_carrier', array('carrier' => 'id')),
|
||||
),
|
||||
'indexes' => array(
|
||||
'user_carrier_idx' => array('carrier'),
|
||||
'user_created_id_idx' => array('created', 'id'),
|
||||
'user_smsemail_idx' => array('smsemail'),
|
||||
),
|
||||
);
|
||||
'fields' => [
|
||||
'id' => ['type' => 'int', 'not null' => true, 'description' => 'foreign key to profile table'],
|
||||
'nickname' => ['type' => 'varchar', 'length' => 64, 'description' => 'nickname or username, duped in profile'],
|
||||
'password' => ['type' => 'text', 'description' => 'salted password, can be null for OpenID users'],
|
||||
'email' => ['type' => 'varchar', 'length' => 191, 'description' => 'email address for password recovery etc.'],
|
||||
'incomingemail' => ['type' => 'varchar', 'length' => 191, 'description' => 'email address for post-by-email'],
|
||||
'emailnotifysub' => ['type' => 'bool', 'default' => true, 'description' => 'Notify by email of subscriptions'],
|
||||
'emailnotifyfav' => ['type' => 'int', 'size' => 'tiny', 'default' => null, 'description' => 'Notify by email of favorites'],
|
||||
'emailnotifynudge' => ['type' => 'bool', 'default' => true, 'description' => 'Notify by email of nudges'],
|
||||
'emailnotifymsg' => ['type' => 'bool', 'default' => true, 'description' => 'Notify by email of direct messages'],
|
||||
'emailnotifyattn' => ['type' => 'bool', 'default' => true, 'description' => 'Notify by email of @-replies'],
|
||||
'language' => ['type' => 'varchar', 'length' => 50, 'description' => 'preferred language'],
|
||||
'timezone' => ['type' => 'varchar', 'length' => 50, 'description' => 'timezone'],
|
||||
'emailpost' => ['type' => 'bool', 'default' => true, 'description' => 'Post by email'],
|
||||
'sms' => ['type' => 'varchar', 'length' => 64, 'description' => 'sms phone number'],
|
||||
'carrier' => ['type' => 'int', 'description' => 'foreign key to sms_carrier'],
|
||||
'smsnotify' => ['type' => 'bool', 'default' => false, 'description' => 'whether to send notices to SMS'],
|
||||
'smsreplies' => ['type' => 'bool', 'default' => false, 'description' => 'whether to send notices to SMS on replies'],
|
||||
'smsemail' => ['type' => 'varchar', 'length' => 191, 'description' => 'built from sms and carrier'],
|
||||
'uri' => ['type' => 'varchar', 'length' => 191, 'description' => 'universally unique identifier, usually a tag URI'],
|
||||
'autosubscribe' => ['type' => 'bool', 'default' => false, 'description' => 'automatically subscribe to users who subscribe to us'],
|
||||
'subscribe_policy' => ['type' => 'int', 'size' => 'tiny', 'default' => 0, 'description' => '0 = anybody can subscribe; 1 = require approval'],
|
||||
'urlshorteningservice' => ['type' => 'varchar', 'length' => 50, 'default' => 'internal', 'description' => 'service to use for auto-shortening URLs'],
|
||||
'private_stream' => ['type' => 'bool', 'default' => false, 'description' => 'whether to limit all notices to followers only'],
|
||||
'created' => ['type' => 'datetime', 'description' => 'date this record was created'],
|
||||
'modified' => ['type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'],
|
||||
],
|
||||
'primary key' => ['id'],
|
||||
'unique keys' => [
|
||||
'user_nickname_key' => ['nickname'],
|
||||
'user_email_key' => ['email'],
|
||||
'user_incomingemail_key' => ['incomingemail'],
|
||||
'user_sms_key' => ['sms'],
|
||||
'user_uri_key' => ['uri'],
|
||||
],
|
||||
'foreign keys' => [
|
||||
'user_id_fkey' => ['profile', ['id' => 'id']],
|
||||
'user_carrier_fkey' => ['sms_carrier', ['carrier' => 'id']],
|
||||
],
|
||||
'indexes' => [
|
||||
'user_carrier_idx' => ['carrier'],
|
||||
'user_created_id_idx' => ['created', 'id'],
|
||||
'user_smsemail_idx' => ['smsemail'],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
protected $_profile = array();
|
||||
protected $_profile = [];
|
||||
|
||||
/**
|
||||
* @return Profile
|
||||
*
|
||||
* @throws UserNoProfileException if user has no profile
|
||||
*/
|
||||
public function getProfile()
|
||||
public function getProfile(): object
|
||||
{
|
||||
if (!isset($this->_profile[$this->id])) {
|
||||
$profile = Profile::getKV('id', $this->id);
|
||||
|
@ -133,12 +135,12 @@ class User extends Managed_DataObject
|
|||
return $this->getProfile()->sameAs($other);
|
||||
}
|
||||
|
||||
public function getUri()
|
||||
public function getUri(): string
|
||||
{
|
||||
return $this->uri;
|
||||
}
|
||||
|
||||
public function getNickname()
|
||||
public function getNickname(): string
|
||||
{
|
||||
return $this->getProfile()->getNickname();
|
||||
}
|
||||
|
@ -147,7 +149,7 @@ class User extends Managed_DataObject
|
|||
{
|
||||
$user = User::getKV('nickname', $nickname);
|
||||
if (!$user instanceof User) {
|
||||
throw new NoSuchUserException(array('nickname' => $nickname));
|
||||
throw new NoSuchUserException(['nickname' => $nickname]);
|
||||
}
|
||||
|
||||
return $user;
|
||||
|
@ -275,7 +277,7 @@ class User extends Managed_DataObject
|
|||
|
||||
$user->created = common_sql_now();
|
||||
|
||||
if (Event::handle('StartUserRegister', array($profile))) {
|
||||
if (Event::handle('StartUserRegister', [$profile])) {
|
||||
$profile->query('START TRANSACTION');
|
||||
|
||||
$id = $profile->insert();
|
||||
|
@ -414,7 +416,7 @@ class User extends Managed_DataObject
|
|||
}
|
||||
}
|
||||
|
||||
Event::handle('EndUserRegister', array($profile));
|
||||
Event::handle('EndUserRegister', [$profile]);
|
||||
}
|
||||
|
||||
if (!$user instanceof User || empty($user->id)) {
|
||||
|
@ -628,14 +630,14 @@ class User extends Managed_DataObject
|
|||
common_log(LOG_INFO, "User {$this->nickname} has no profile; continuing deletion.");
|
||||
}
|
||||
|
||||
$related = array(
|
||||
'Confirm_address',
|
||||
'Remember_me',
|
||||
'Foreign_link',
|
||||
'Invitation',
|
||||
);
|
||||
$related = [
|
||||
'Confirm_address',
|
||||
'Remember_me',
|
||||
'Foreign_link',
|
||||
'Invitation',
|
||||
];
|
||||
|
||||
Event::handle('UserDeleteRelated', array($this, &$related));
|
||||
Event::handle('UserDeleteRelated', [$this, &$related]);
|
||||
|
||||
foreach ($related as $cls) {
|
||||
$inst = new $cls();
|
||||
|
@ -873,7 +875,7 @@ class User extends Managed_DataObject
|
|||
public function __sleep()
|
||||
{
|
||||
$vars = parent::__sleep();
|
||||
$skip = array('_profile');
|
||||
$skip = ['_profile'];
|
||||
return array_diff($vars, $skip);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
function dd (mixed $val): void {
|
||||
printf("<pre>");
|
||||
var_dump($val);
|
||||
printf("</pre>");
|
||||
die();
|
||||
}
|
||||
|
||||
function stacktrace (bool $return = false): array {
|
||||
$st = debug_backtrace();
|
||||
if (!$return) {
|
||||
error_log(print_r($st, true));
|
||||
return [];
|
||||
}
|
||||
else {
|
||||
return $st;
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -1,4 +1,4 @@
|
|||
FROM php:7.4-apache
|
||||
FROM php:8.2-apache
|
||||
RUN apt update && apt install -y \
|
||||
ssl-cert \
|
||||
libicu-dev \
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
version: "3"
|
||||
services:
|
||||
db:
|
||||
image: mariadb:10.3
|
||||
image: mariadb:11.0.3
|
||||
restart: always
|
||||
volumes:
|
||||
- gnusocial-db:/var/lib/mysql
|
||||
|
|
|
@ -341,7 +341,6 @@ class DB_DataObject_Cast
|
|||
* @return string
|
||||
* @access public
|
||||
*/
|
||||
|
||||
public function toString($db, $to = false)
|
||||
{
|
||||
// if $this->type is not set, we are in serious trouble!!!!
|
||||
|
@ -361,7 +360,7 @@ class DB_DataObject_Cast
|
|||
* @return string
|
||||
* @access public
|
||||
*/
|
||||
public function toStringFromBlob($to, $db)
|
||||
public function toStringFromBlob($db, $to)
|
||||
{
|
||||
// first weed out invalid casts..
|
||||
// in blobs can only be cast to blobs.!
|
||||
|
@ -413,7 +412,7 @@ class DB_DataObject_Cast
|
|||
* @return string
|
||||
* @access public
|
||||
*/
|
||||
public function toStringFromString($to, $db)
|
||||
public function toStringFromString($db, $to)
|
||||
{
|
||||
// first weed out invalid casts..
|
||||
// in blobs can only be cast to blobs.!
|
||||
|
@ -464,7 +463,7 @@ class DB_DataObject_Cast
|
|||
* @return string
|
||||
* @access public
|
||||
*/
|
||||
public function toStringFromDate($to, $db)
|
||||
public function toStringFromDate($db, $to)
|
||||
{
|
||||
// first weed out invalid casts..
|
||||
// in blobs can only be cast to blobs.!
|
||||
|
@ -492,7 +491,7 @@ class DB_DataObject_Cast
|
|||
* @author therion 5 at hotmail
|
||||
*/
|
||||
|
||||
public function toStringFromDateTime($to, $db)
|
||||
public function toStringFromDateTime($db, $to)
|
||||
{
|
||||
// first weed out invalid casts..
|
||||
// in blobs can only be cast to blobs.!
|
||||
|
@ -520,7 +519,7 @@ class DB_DataObject_Cast
|
|||
* @author therion 5 at hotmail
|
||||
*/
|
||||
|
||||
public function toStringFromTime($to, $db)
|
||||
public function toStringFromTime($db, $to)
|
||||
{
|
||||
// first weed out invalid casts..
|
||||
// in blobs can only be cast to blobs.!
|
||||
|
@ -543,7 +542,7 @@ class DB_DataObject_Cast
|
|||
* @return string
|
||||
* @access public
|
||||
*/
|
||||
public function toStringFromSql($to, $db)
|
||||
public function toStringFromSql($db, $to)
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
|
|
@ -720,7 +720,7 @@ class HTTP_Request2 implements SplSubject
|
|||
*
|
||||
* @param SplObserver $observer any object implementing SplObserver
|
||||
*/
|
||||
public function attach(SplObserver $observer)
|
||||
public function attach(SplObserver $observer): void
|
||||
{
|
||||
foreach ($this->observers as $attached) {
|
||||
if ($attached === $observer) {
|
||||
|
@ -735,7 +735,7 @@ class HTTP_Request2 implements SplSubject
|
|||
*
|
||||
* @param SplObserver $observer any object implementing SplObserver
|
||||
*/
|
||||
public function detach(SplObserver $observer)
|
||||
public function detach(SplObserver $observer): void
|
||||
{
|
||||
foreach ($this->observers as $key => $attached) {
|
||||
if ($attached === $observer) {
|
||||
|
@ -748,7 +748,7 @@ class HTTP_Request2 implements SplSubject
|
|||
/**
|
||||
* Notifies all observers
|
||||
*/
|
||||
public function notify()
|
||||
public function notify(): void
|
||||
{
|
||||
foreach ($this->observers as $observer) {
|
||||
$observer->update($this);
|
||||
|
@ -927,14 +927,11 @@ class HTTP_Request2 implements SplSubject
|
|||
HTTP_Request2_Exception::INVALID_ARGUMENT
|
||||
);
|
||||
}
|
||||
|
||||
if (empty($this->adapter)) {
|
||||
$this->setAdapter($this->getConfig('adapter'));
|
||||
}
|
||||
// magic_quotes_runtime may break file uploads and chunked response
|
||||
// processing; see bug #4543. Don't use ini_get() here; see bug #16440.
|
||||
if ($magicQuotes = get_magic_quotes_runtime()) {
|
||||
set_magic_quotes_runtime(false);
|
||||
}
|
||||
|
||||
// force using single byte encoding if mbstring extension overloads
|
||||
// strlen() and substr(); see bug #1781, bug #10605
|
||||
if (extension_loaded('mbstring') && (2 & ini_get('mbstring.func_overload'))) {
|
||||
|
@ -946,17 +943,16 @@ class HTTP_Request2 implements SplSubject
|
|||
$response = $this->adapter->sendRequest($this);
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
// cleanup in either case (poor man's "finally" clause)
|
||||
if ($magicQuotes) {
|
||||
set_magic_quotes_runtime(true);
|
||||
}
|
||||
|
||||
if (!empty($oldEncoding)) {
|
||||
mb_internal_encoding($oldEncoding);
|
||||
}
|
||||
|
||||
// rethrow the exception
|
||||
if (!empty($e)) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
|
|
@ -385,7 +385,7 @@ class HTTP_Request2_Adapter_Socket extends HTTP_Request2_Adapter
|
|||
return true;
|
||||
}
|
||||
|
||||
$lengthKnown = 'chunked' == strtolower($response->getHeader('transfer-encoding'))
|
||||
$lengthKnown = 'chunked' == strtolower($response->getHeader('transfer-encoding') ?? "")
|
||||
|| null !== $response->getHeader('content-length')
|
||||
// no body possible for such responses, see also request #17031
|
||||
|| HTTP_Request2::METHOD_HEAD == $this->request->getMethod()
|
||||
|
@ -1135,4 +1135,4 @@ class HTTP_Request2_Adapter_Socket extends HTTP_Request2_Adapter
|
|||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -53,6 +53,8 @@ require_once 'HTTP/Request2/Exception.php';
|
|||
*/
|
||||
class HTTP_Request2_Response
|
||||
{
|
||||
public $redirUrls;
|
||||
|
||||
/**
|
||||
* HTTP protocol version (e.g. 1.0, 1.1)
|
||||
* @var string
|
||||
|
@ -677,4 +679,4 @@ class HTTP_Request2_Response
|
|||
return (0 == $header[1] % 31)? gzuncompress($data): gzinflate($data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -195,11 +195,13 @@ class HTTP_Request2_SocketWrapper
|
|||
$info = stream_get_meta_data($this->socket);
|
||||
$old_blocking = (bool)$info['blocked'];
|
||||
stream_set_blocking($this->socket, false);
|
||||
$r = array($this->socket);
|
||||
$w = array();
|
||||
$e = array();
|
||||
$r = [$this->socket];
|
||||
$w = [];
|
||||
$e = [];
|
||||
if (stream_select($r, $w, $e, $timeout)) {
|
||||
$line .= @fgets($this->socket, $bufferSize);
|
||||
} else {
|
||||
echo "stream_select失敗: " . error_get_last()['message'];
|
||||
}
|
||||
stream_set_blocking($this->socket, $old_blocking);
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ class IDNATest extends PHPUnit_Framework_TestCase
|
|||
|
||||
public static function unichr($chr)
|
||||
{
|
||||
return mb_convert_encoding('&#' . intval($chr) . ';', 'UTF-8', 'HTML-ENTITIES');
|
||||
return htmlspecialchars('&#' . intval($chr) . ';', ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
|
||||
}
|
||||
|
||||
private function hexarray2string($arr)
|
||||
|
|
|
@ -12,6 +12,7 @@ if (!class_exists('OAuthException')) {
|
|||
class OAuthConsumer {
|
||||
public $key;
|
||||
public $secret;
|
||||
public $callback_url;
|
||||
|
||||
function __construct($key, $secret, $callback_url=NULL) {
|
||||
$this->key = $key;
|
||||
|
@ -100,7 +101,7 @@ abstract class OAuthSignatureMethod {
|
|||
// Avoid a timing leak with a (hopefully) time insensitive compare
|
||||
$result = 0;
|
||||
for ($i = 0; $i < strlen($signature); $i++) {
|
||||
$result |= ord($built{$i}) ^ ord($signature{$i});
|
||||
$result |= ord($built[$i]) ^ ord($signature[$i]);
|
||||
}
|
||||
|
||||
return $result == 0;
|
||||
|
|
|
@ -175,10 +175,8 @@ function _get_codeset($domain=null) {
|
|||
*/
|
||||
function _encode($text) {
|
||||
$target_encoding = _get_codeset();
|
||||
if (function_exists("mb_detect_encoding")) {
|
||||
$source_encoding = mb_detect_encoding($text);
|
||||
if ($source_encoding != $target_encoding)
|
||||
$text = mb_convert_encoding($text, $target_encoding, $source_encoding);
|
||||
if ($source_encoding != $target_encoding) {
|
||||
$text = htmlspecialchars($text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
* @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
|
||||
*/
|
||||
defined('GNUSOCIAL') || die();
|
||||
include("../classes/Profile.php");
|
||||
|
||||
/**
|
||||
* Base class for all actions
|
||||
|
@ -45,6 +46,8 @@ defined('GNUSOCIAL') || die();
|
|||
*/
|
||||
class Action extends HTMLOutputter // lawsuit
|
||||
{
|
||||
public $widgetOpts;
|
||||
|
||||
// This should be protected/private in the future
|
||||
public $args = [];
|
||||
|
||||
|
|
|
@ -44,6 +44,9 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
|||
*/
|
||||
class ErrorAction extends InfoAction
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
static $status = [];
|
||||
|
||||
var $code = null;
|
||||
|
|
|
@ -45,6 +45,9 @@ defined('GNUSOCIAL') || die();
|
|||
*/
|
||||
class ServerErrorAction extends ErrorAction
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $title;
|
||||
public $minimal;
|
||||
|
||||
|
|
|
@ -44,6 +44,11 @@ defined('GNUSOCIAL') || die();
|
|||
*/
|
||||
class Activity
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $type;
|
||||
|
||||
const SPEC = 'http://activitystrea.ms/spec/1.0/';
|
||||
const SCHEMA = 'http://activitystrea.ms/schema/1.0/';
|
||||
const MEDIA = 'http://purl.org/syndication/atommedia';
|
||||
|
|
|
@ -34,6 +34,9 @@ if (!defined('STATUSNET')) {
|
|||
|
||||
class ActivityContext
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $replyToID;
|
||||
public $replyToUrl;
|
||||
public $location;
|
||||
|
|
|
@ -42,6 +42,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
*/
|
||||
class ActivityImporter extends QueueHandler
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
private $trusted = false;
|
||||
|
||||
/**
|
||||
|
|
|
@ -46,6 +46,9 @@ if (!defined('STATUSNET')) {
|
|||
*/
|
||||
class ActivityMover extends QueueHandler
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
function transport()
|
||||
{
|
||||
return 'actmove';
|
||||
|
|
|
@ -53,6 +53,9 @@ require_once INSTALLDIR . '/lib/activitystreams/activitystreamjsondocument.php';
|
|||
*/
|
||||
class ActivityObject
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
const ARTICLE = 'http://activitystrea.ms/schema/1.0/article';
|
||||
const BLOGENTRY = 'http://activitystrea.ms/schema/1.0/blog-entry';
|
||||
const NOTE = 'http://activitystrea.ms/schema/1.0/note';
|
||||
|
|
|
@ -42,6 +42,8 @@ if (!defined('GNUSOCIAL')) {
|
|||
*/
|
||||
class ActivityStreamJSONDocument extends JSONActivityCollection
|
||||
{
|
||||
public $widgetOpts;
|
||||
|
||||
// Note: Lot of AS folks think the content type should be:
|
||||
// 'application/stream+json; charset=utf-8', but this is more
|
||||
// useful at the moment, because some programs actually understand
|
||||
|
@ -53,7 +55,7 @@ class ActivityStreamJSONDocument extends JSONActivityCollection
|
|||
|
||||
/* The current authenticated user */
|
||||
protected $cur;
|
||||
protected $scoped = null;
|
||||
public $scoped;
|
||||
|
||||
/* Title of the document */
|
||||
protected $title;
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
class ActivityStreamsLink
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
private $linkDict;
|
||||
|
||||
function __construct($url = null, $rel = null, $mediaType = null)
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
class ActivityStreamsMediaLink extends ActivityStreamsLink
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
private $linkDict;
|
||||
|
||||
function __construct(
|
||||
|
|
|
@ -48,6 +48,9 @@ if (!defined('STATUSNET')) {
|
|||
*/
|
||||
class ActivityUtils
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
const ATOM = 'http://www.w3.org/2005/Atom';
|
||||
|
||||
const LINK = 'link';
|
||||
|
|
|
@ -44,6 +44,9 @@ if (!defined('STATUSNET')) {
|
|||
*/
|
||||
class ActivityVerb
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
const POST = 'http://activitystrea.ms/schema/1.0/post';
|
||||
const SHARE = 'http://activitystrea.ms/schema/1.0/share';
|
||||
const SAVE = 'http://activitystrea.ms/schema/1.0/save';
|
||||
|
|
|
@ -8,6 +8,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
* A valid Collection object serialization MUST contain at least the url or items properties.
|
||||
*/
|
||||
class JSONActivityCollection {
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
|
||||
/* Non-negative integer specifying the total number of activities within the stream */
|
||||
protected $totalItems;
|
||||
|
|
|
@ -37,6 +37,9 @@ defined('GNUSOCIAL') || die();
|
|||
*/
|
||||
class UserActivityStream extends AtomUserNoticeFeed
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $activities = array();
|
||||
public $after = null;
|
||||
|
||||
|
|
|
@ -47,6 +47,9 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
|
|||
*/
|
||||
class AdminForm extends Form
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/**
|
||||
* Utility to simplify some of the duplicated code around
|
||||
* params and settings.
|
||||
|
|
|
@ -46,6 +46,9 @@ if (!defined('STATUSNET')) {
|
|||
*/
|
||||
class AdminPanelAction extends Action
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
var $success = true;
|
||||
var $msg = null;
|
||||
|
||||
|
|
|
@ -47,6 +47,9 @@ if (!defined('STATUSNET')) {
|
|||
*/
|
||||
class AdminPanelNav extends Menu
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/**
|
||||
* Show the menu
|
||||
*
|
||||
|
|
|
@ -47,6 +47,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
*/
|
||||
class DeleteGroupForm extends Form
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/**
|
||||
* group for user to delete
|
||||
*/
|
||||
|
|
|
@ -43,6 +43,9 @@ if (!defined('STATUSNET')) {
|
|||
*/
|
||||
class DeleteUserForm extends ProfileActionForm
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/**
|
||||
* Action this form provides
|
||||
*
|
||||
|
|
|
@ -29,6 +29,9 @@
|
|||
|
||||
class DelUserQueueHandler extends QueueHandler
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
const DELETION_WINDOW = 50;
|
||||
|
||||
public function transport()
|
||||
|
|
|
@ -44,6 +44,11 @@ if (!defined('STATUSNET')) {
|
|||
*/
|
||||
class GrantRoleForm extends ProfileActionForm
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
public $role;
|
||||
public $label;
|
||||
|
||||
function __construct($role, $label, $writer, $profile, $r2args)
|
||||
{
|
||||
parent::__construct($writer, $profile, $r2args);
|
||||
|
|
|
@ -27,6 +27,9 @@ defined('STATUSNET') || die();
|
|||
*/
|
||||
class PluginDeleteForm extends PluginEnableForm
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/**
|
||||
* Plugin to delete
|
||||
*/
|
||||
|
|
|
@ -29,6 +29,9 @@ defined('STATUSNET') || die();
|
|||
*/
|
||||
class PluginDisableForm extends PluginEnableForm
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/**
|
||||
* ID of the form
|
||||
*
|
||||
|
|
|
@ -31,6 +31,9 @@ require_once INSTALLDIR . '/lib/util/form.php';
|
|||
*/
|
||||
class PluginEnableForm extends Form
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/**
|
||||
* Plugin to enable/disable
|
||||
*/
|
||||
|
|
|
@ -30,6 +30,9 @@ require INSTALLDIR . "/lib/admin/plugindisableform.php";
|
|||
*/
|
||||
class PluginList extends Widget
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $plugins = [];
|
||||
|
||||
/**
|
||||
|
|
|
@ -44,6 +44,11 @@ if (!defined('STATUSNET')) {
|
|||
*/
|
||||
class RevokeRoleForm extends ProfileActionForm
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
public $role;
|
||||
public $label;
|
||||
|
||||
function __construct($role, $label, $writer, $profile, $r2args)
|
||||
{
|
||||
parent::__construct($writer, $profile, $r2args);
|
||||
|
|
|
@ -44,6 +44,9 @@ if (!defined('STATUSNET')) {
|
|||
*/
|
||||
class SandboxForm extends ProfileActionForm
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/**
|
||||
* Action this form provides
|
||||
*
|
||||
|
|
|
@ -44,6 +44,9 @@ if (!defined('STATUSNET')) {
|
|||
*/
|
||||
class SilenceForm extends ProfileActionForm
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/**
|
||||
* Action this form provides
|
||||
*
|
||||
|
|
|
@ -46,6 +46,9 @@ if (!defined('STATUSNET')) {
|
|||
*/
|
||||
class UnsandboxForm extends ProfileActionForm
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/**
|
||||
* Action this form provides
|
||||
*
|
||||
|
|
|
@ -44,6 +44,9 @@ if (!defined('STATUSNET')) {
|
|||
*/
|
||||
class UnSilenceForm extends ProfileActionForm
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/**
|
||||
* Action this form provides
|
||||
*
|
||||
|
|
|
@ -112,6 +112,9 @@ class ApiValidationException extends Exception
|
|||
*/
|
||||
class ApiAction extends Action
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
const READ_ONLY = 1;
|
||||
const READ_WRITE = 2;
|
||||
public static $reserved_sources = ['web', 'omb', 'ostatus', 'mail', 'xmpp', 'api'];
|
||||
|
|
|
@ -66,6 +66,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
*/
|
||||
class ApiAuthAction extends ApiAction
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
var $auth_user_nickname = null;
|
||||
var $auth_user_password = null;
|
||||
|
||||
|
|
|
@ -60,6 +60,9 @@ if (!defined('STATUSNET')) {
|
|||
*/
|
||||
class ApiBareAuthAction extends ApiAuthAction
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/**
|
||||
* Does this API resource require authentication?
|
||||
*
|
||||
|
|
|
@ -26,6 +26,9 @@ require_once 'OAuth.php';
|
|||
*/
|
||||
class ApiGNUsocialOAuthDataStore extends OAuthDataStore
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
function lookup_consumer($consumer_key)
|
||||
{
|
||||
$con = Consumer::getKV('consumer_key', $consumer_key);
|
||||
|
|
|
@ -31,6 +31,9 @@ if (!defined('STATUSNET')) {
|
|||
|
||||
class ApiListUsersAction extends ApiBareAuthAction
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
var $list = null;
|
||||
var $user = false;
|
||||
var $create = false;
|
||||
|
|
|
@ -39,6 +39,9 @@ require_once INSTALLDIR . '/lib/api/apiaction.php';
|
|||
*/
|
||||
class ApiOAuthAction extends ApiAction
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/**
|
||||
* Is this a read-only action?
|
||||
*
|
||||
|
|
|
@ -58,6 +58,9 @@ if (!defined('STATUSNET')) {
|
|||
*/
|
||||
class ApiPrivateAuthAction extends ApiAuthAction
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/**
|
||||
* Does this API resource require authentication?
|
||||
*
|
||||
|
|
|
@ -45,6 +45,9 @@ require_once INSTALLDIR . '/lib/util/form.php';
|
|||
*/
|
||||
class ApplicationEditForm extends Form
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/**
|
||||
* group for user to join
|
||||
*/
|
||||
|
|
|
@ -40,6 +40,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
*/
|
||||
class ApplicationList extends Widget
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/** Current application, application query */
|
||||
var $application = null;
|
||||
|
||||
|
|
|
@ -43,6 +43,9 @@
|
|||
*/
|
||||
class Cache
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/**
|
||||
* @var array additional in-process cache for web requests;
|
||||
* disabled on CLI, unsafe for long-running daemons
|
||||
|
|
|
@ -42,6 +42,9 @@ if (!defined('STATUSNET')) {
|
|||
*/
|
||||
class ColumnDef
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/** name of the column. */
|
||||
public $name;
|
||||
/** type of column, e.g. 'int', 'varchar' */
|
||||
|
|
|
@ -49,6 +49,9 @@ require_once INSTALLDIR . '/lib/action/servererroraction.php';
|
|||
*/
|
||||
class DBErrorAction extends ServerErrorAction
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
function __construct($message='Error', $code=500)
|
||||
{
|
||||
parent::__construct($message, $code);
|
||||
|
|
|
@ -38,6 +38,9 @@ defined('GNUSOCIAL') || die();
|
|||
*/
|
||||
class MysqlSchema extends Schema
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public static $_single = null;
|
||||
|
||||
/**
|
||||
|
@ -629,7 +632,7 @@ class MysqlSchema extends Schema
|
|||
case 'bool':
|
||||
$col['type'] = 'int';
|
||||
$col['size'] = 'tiny';
|
||||
$col['default'] = (int) $col['default'];
|
||||
if (array_key_exists('default', $col)) $col['default'] = (int) $col['default'];
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,9 @@ defined('GNUSOCIAL') || die();
|
|||
*/
|
||||
class PgsqlSchema extends Schema
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public static $_single = null;
|
||||
|
||||
/**
|
||||
|
|
|
@ -39,6 +39,9 @@ defined('GNUSOCIAL') || die();
|
|||
*/
|
||||
class Schema
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public static $_static = null;
|
||||
protected $conn = null;
|
||||
|
||||
|
|
|
@ -28,6 +28,9 @@ defined('GNUSOCIAL') || die();
|
|||
|
||||
class SchemaUpdater
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public function __construct($schema)
|
||||
{
|
||||
$this->schema = $schema;
|
||||
|
|
|
@ -43,6 +43,9 @@ if (!defined('STATUSNET')) {
|
|||
|
||||
class TableDef
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/** name of the table */
|
||||
public $name;
|
||||
/** array of ColumnDef objects for the columns. */
|
||||
|
|
|
@ -39,6 +39,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
|
||||
class AlreadyFulfilledException extends ServerException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public function __construct($msg=null)
|
||||
{
|
||||
if ($msg === null) {
|
||||
|
|
|
@ -33,6 +33,9 @@ defined('GNUSOCIAL') || die();
|
|||
*/
|
||||
class AlreadyHandledException extends ServerException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public function __construct($msg)
|
||||
{
|
||||
parent::__construct($msg, 202);
|
||||
|
|
|
@ -47,6 +47,9 @@ if (!defined('STATUSNET')) {
|
|||
|
||||
class AuthorizationException extends ClientException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
|
|
@ -38,6 +38,9 @@ defined('GNUSOCIAL') || die();
|
|||
*/
|
||||
class ClientException extends Exception
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public function __construct(
|
||||
string $message = '',
|
||||
int $code = 500,
|
||||
|
|
|
@ -16,6 +16,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
|
||||
class ConfigException extends ServerException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public function __construct($message=null) {
|
||||
parent::__construct($message, 500);
|
||||
}
|
||||
|
|
|
@ -31,6 +31,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
|
||||
class EmptyPkeyValueException extends ServerException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public function __construct($called_class, $key=null)
|
||||
{
|
||||
// FIXME: translate the 'not specified' case?
|
||||
|
|
|
@ -31,6 +31,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
|
||||
class FileNotFoundException extends ServerException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $path = null;
|
||||
|
||||
public function __construct($path)
|
||||
|
|
|
@ -4,6 +4,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
|
||||
class FileNotStoredLocallyException extends ServerException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $file = null;
|
||||
|
||||
public function __construct(File $file)
|
||||
|
|
|
@ -41,6 +41,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
|
||||
class GroupNoProfileException extends NoProfileException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
protected $group = null;
|
||||
|
||||
/**
|
||||
|
|
|
@ -41,6 +41,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
|
||||
class InvalidFilenameException extends ServerException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $filename = null;
|
||||
|
||||
public function __construct($filename)
|
||||
|
|
|
@ -41,6 +41,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
|
||||
class InvalidUrlException extends ServerException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $url = null;
|
||||
|
||||
public function __construct($url)
|
||||
|
|
|
@ -43,6 +43,9 @@ if (!defined('GNUSOCIAL')) {
|
|||
|
||||
class MethodNotImplementedException extends ServerException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public function __construct($method)
|
||||
{
|
||||
parent::__construct(sprintf(_('Method %s not implemented'), $method));
|
||||
|
|
|
@ -31,6 +31,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
|
||||
class NoAvatarException extends NoResultException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $target;
|
||||
|
||||
public function __construct(Profile $target, Avatar $obj)
|
||||
|
|
|
@ -32,6 +32,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
// Can't extend HTTP_Request2_Exception since it requires an HTTP status code which we didn't get
|
||||
class NoHttpResponseException extends HTTP_Request2_ConnectionException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $url; // target URL
|
||||
|
||||
public function __construct($url)
|
||||
|
|
|
@ -31,6 +31,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
|
||||
class NoObjectTypeException extends ServerException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $stored; // The object with query that gave no results
|
||||
|
||||
public function __construct(Notice $stored)
|
||||
|
|
|
@ -31,6 +31,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
|
||||
class NoParentNoticeException extends ServerException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $notice; // The notice which has no parent
|
||||
|
||||
public function __construct(Notice $notice)
|
||||
|
|
|
@ -41,6 +41,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
|
||||
class NoProfileException extends ServerException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $profile_id = null;
|
||||
|
||||
public function __construct($profile_id, $msg=null)
|
||||
|
|
|
@ -31,6 +31,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
|
||||
class NoQueueHandlerException extends ServerException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $transport; // The object with query that gave no results
|
||||
|
||||
public function __construct($transport)
|
||||
|
|
|
@ -31,6 +31,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
|
||||
class NoResultException extends ServerException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $obj; // The object with query that gave no results
|
||||
|
||||
public function __construct(Memcached_DataObject $obj)
|
||||
|
|
|
@ -31,6 +31,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
|
||||
class NoRouteMapException extends Exception
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $path; // The object with query that gave no results
|
||||
|
||||
public function __construct($path)
|
||||
|
|
|
@ -43,6 +43,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
|
||||
class NoSuchGroupException extends ServerException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $data = array();
|
||||
|
||||
/**
|
||||
|
|
|
@ -43,6 +43,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
|
||||
class NoSuchUserException extends ServerException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $data = array();
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,6 +14,9 @@ if (!defined('GNUSOCIAL')) { exit(1); }
|
|||
|
||||
class NoUploadedMediaException extends ClientException
|
||||
{
|
||||
public $widgetOpts;
|
||||
public $scoped;
|
||||
|
||||
public $fieldname = null;
|
||||
|
||||
public function __construct($fieldname, $msg=null)
|
||||
|
|
変更されたファイルが多すぎるため、一部のファイルは表示されません さらに表示
読み込み中…
新しいイシューから参照