Browse Source

Merge pull request #5789 from friendica/master

Update develop from master-2019.09
pull/5790/head
Hypolite Petovan 3 years ago
committed by GitHub
parent
commit
a6996601d5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 131
      CHANGELOG
  2. 2
      VERSION
  3. 2
      boot.php
  4. 3
      composer.json
  5. 237
      composer.lock
  6. 2
      doc/Developers-Intro.md
  7. 2
      doc/Quick-Start-groupsandpages.md
  8. 2
      doc/de/FAQ.md
  9. 2
      doc/de/Home.md
  10. 51
      include/api.php
  11. 8
      include/conversation.php
  12. 3
      include/items.php
  13. 55
      include/text.php
  14. 47
      mod/babel.php
  15. 4
      mod/bookmarklet.php
  16. 25
      mod/contacts.php
  17. 18
      mod/dfrn_notify.php
  18. 2
      mod/dirfind.php
  19. 144
      mod/events.php
  20. 2
      mod/fetch.php
  21. 10
      mod/item.php
  22. 65
      mod/lockview.php
  23. 2
      mod/message.php
  24. 7
      mod/notes.php
  25. 264
      mod/notifications.php
  26. 102
      mod/parse_url.php
  27. 8
      mod/photos.php
  28. 17
      mod/ping.php
  29. 37
      mod/poke.php
  30. 2
      mod/profile.php
  31. 8
      mod/salmon.php
  32. 158
      mod/unfollow.php
  33. 39
      mod/update_contacts.php
  34. 3
      mod/videos.php
  35. 2
      mod/webfinger.php
  36. 35
      src/App.php
  37. 2
      src/BaseModule.php
  38. 2
      src/Content/OEmbed.php
  39. 107
      src/Content/Text/BBCode.php
  40. 20
      src/Content/Text/HTML.php
  41. 3
      src/Content/Text/Markdown.php
  42. 2
      src/Core/ACL.php
  43. 2
      src/Core/Cache/DatabaseCacheDriver.php
  44. 2
      src/Core/Cache/ICacheDriver.php
  45. 2
      src/Core/Cache/MemcacheCacheDriver.php
  46. 2
      src/Core/Cache/MemcachedCacheDriver.php
  47. 2
      src/Core/Cache/RedisCacheDriver.php
  48. 2
      src/Core/Config/IConfigAdapter.php
  49. 2
      src/Core/Config/JITConfigAdapter.php
  50. 2
      src/Core/Config/JITPConfigAdapter.php
  51. 2
      src/Core/Config/PreloadConfigAdapter.php
  52. 2
      src/Core/Config/PreloadPConfigAdapter.php
  53. 2
      src/Core/Console.php
  54. 4
      src/Core/Console/Config.php
  55. 2
      src/Core/Console/CreateDoxygen.php
  56. 6
      src/Core/Console/DatabaseStructure.php
  57. 2
      src/Core/Console/DocBloxErrorChecker.php
  58. 2
      src/Core/Console/Extract.php
  59. 4
      src/Core/Console/GlobalCommunityBlock.php
  60. 4
      src/Core/Console/GlobalCommunitySilence.php
  61. 2
      src/Core/Console/Maintenance.php
  62. 2
      src/Core/Console/PhpToPo.php
  63. 2
      src/Core/Console/PoToPhp.php
  64. 41
      src/Core/Console/PostUpdate.php
  65. 2
      src/Core/Console/Typo.php
  66. 4
      src/Core/L10n.php
  67. 38
      src/Core/Protocol.php
  68. 2
      src/Core/Session.php
  69. 2
      src/Core/Session/CacheSessionHandler.php
  70. 2
      src/Core/Session/DatabaseSessionHandler.php
  71. 97
      src/Database/PostUpdate.php
  72. 17
      src/Model/Contact.php
  73. 7
      src/Model/Event.php
  74. 18
      src/Model/Item.php
  75. 4
      src/Model/Profile.php
  76. 2
      src/Model/User.php
  77. 2
      src/Module/Feed.php
  78. 2
      src/Module/Login.php
  79. 2
      src/Module/Logout.php
  80. 2
      src/Module/Oembed.php
  81. 5
      src/Module/Proxy.php
  82. 44
      src/Network/Probe.php
  83. 2
      src/Object/Image.php
  84. 2
      src/Object/OEmbed.php
  85. 25
      src/Protocol/DFRN.php
  86. 39
      src/Protocol/Diaspora.php
  87. 7
      src/Protocol/Feed.php
  88. 16
      src/Protocol/OStatus.php
  89. 6
      src/Protocol/PortableContact.php
  90. 2
      src/Render/FriendicaSmarty.php
  91. 2
      src/Render/FriendicaSmartyEngine.php
  92. 2
      src/Util/Emailer.php
  93. 2
      src/Util/HTTPSignature.php
  94. 317
      src/Util/ParseUrl.php
  95. 4
      src/Worker/Delivery.php
  96. 45
      src/Worker/Notifier.php
  97. 4
      src/Worker/RemoveContact.php
  98. 6
      util/credits.txt
  99. 1
      view/global.css
  100. 9
      view/js/main.js

131
CHANGELOG

@ -1,3 +1,134 @@
Version 2018.09 (2018-09-23)
Friendica Core:
Update to the translation (CS, DE, EN-US, FI, IT, NL, PL, ZH-CN) [translation teams]
Update to the documentation [Aditoo17, annando, astifter, rebeka-catalina, fabrixxm, M-arcus, microgroove, nupplaphil, tobiasd]
Enhancements to the database structure, handling and documentation [abanink, Angristan, annando, miqrogroove, tobiasd]
Enhancements of unit testing [abanink, nupplaphil, rudloff]
Enhancements to labelling of UI elements [andyhee, tobiasd]
Enhancements to the background workers [annando, miqrogroove, rabuzarus]
Enhancements to the PHP7.2 compatibility [annando, miqrogroove, MrPetovan]
Enhancements to the content filter [MrPetovan]
Enhancements to the hooks provided for addons [abanink]
Enhancements to the interaction with public postings [annando]
Enhancements to the config storage [frabrixxm]
Enhancements to the themes (frio, quattro, smoothly, vier) [annando, astifter, hoergen, MrPetovan, rabuzarus, tobiasd]
Enhancements to the handling of locks [nupplaphil]
Enhancements to the redis integration [nupplaphil]
Enhancements to the admin panel [JeroenED, tobiasd]
Enhancements to the user import process [annando]
Enhancements to the display of invitation information [JeroenED]
Enhancements to the automatic installation process [nupplaphil]
Enhancements to the contact group UI [annando, astifter]
Enhancements to the call of JS [hypolite]
Enhancements to the storage of items in the database [annando]
Enhancements to the process of changing relationships [annando]
Enhancements to the OEmbed of data [MrPetovan]
Fixed various PHP notice occurrences [annando, MrPetovan]
Fixed a bug that could lead to the display of posts from deleted accounts on the community page for a short period [annando]
Fixed a bug that prevented email notification to be send out [annando]
Fixed a bug in database optimisation [annando]
Fixed a bug during removing contacts [annando]
Fixed a bug in the tag-cloud widget [annando]
Fixed a bug in the daemon mode of the background worker [annando]
Fixed a bug in the frio theme that contact filtering [rabuzarus]
Fixed a bug that mangled the display of some additional smileys [abanink]
Fixed a bug in generating registration mails [MrPetovan]
Fixed a bug that caused blank re-share bodies [MrPetovon]
Fixed a bug in the API handling of private mails [fabrixxm]
Fixed a bug when calling the mail() function [miqrogroove]
Fixed a bug that caused deleted accounts being displayed in the local directory [miqrogroove]
Fixed a bug when checking the domain of an email address [VVelox]
Fixed a bug that prevented re-shares from Twitter to be shown as this [annando]
Fixed a bug that caused broken profile links [miqrogroove]
Fixed a bug that caused content from unknown accounts appearing in the timeline [annando]
Fixed a bug with the ignoring and blocking of contacts [annando]
Fixed a bug with showing hidden contacts in some places [annando]
Fixed a bug that prevented the deletion of events by contacts [annando]
Fixed a bug that prevented email contacts from being added [annando]
Fixed a bug in the notification/seen API call [fabrixxm]
Fixed a bug that prevented a refresh after un-/ignoring a conversation [annando]
Fixed a bug in the handling of some language translations [anndno]
Fixed a bug in the hook handling [annando]
Fixed the handling of too long tags [annando]
Fixed a bug that prevented the unliking of dis-/likes [annando]
Fixed bugs with the handling of private nodes [annando]
Fixed a bug in the session initialisation [annando]
Fixed bugs in the execution of the background processes [annando, Quix0r]
Fixed a problem with the notification page [MrPetovan]
Fixed a bug with wrong dates in importing some Atom feeds [annando]
Fixed forum exclusive distribution of postings using the !notation [annando]
Fixed a bug that lead to empty notifications [MrPetovan]
Fixed a problem that could sometimes prevent the execution of the relocation [annando]
Fixed a bug with the handling of images in postings over the connectors [annando]
Added conversation cleanup configuration [miqrogroove]
Added support of the usage of internal diaspora links to accounts [annando]
Added the possibility for admins to block certain nicknames (e.g. role names) [tobiasd]
Added the generation of system guid [nupplaphil]
Added the possibility for admins to mark a node for explicit content [tobiasd]
Added filter by account type to the community page [annando]
Added private flag to API results [fabrixxm]
Added post update checks to the console utility [annando]
Added codecov analysis [nupplaphil]
Added access-keys to the frio theme [tobiasd]
Added the profile settings to the user settings [tobiasd]
General code refactoring and beautification work [annando, MrPetovan, Quix0r, tobiasd]
Fixation of the position on the network page when new posts arrive [rabuzarus]
Ported OpenWebAuth from Hubzilla [annando, rabuzarus]
Removed hard coded syntax highlighting from code blocks [MrPetovan]
Removed (temporarily) the possibility to add pictures to private messages [annando]
New INI style config file format in /config [MrPetovan, tobiasd]
The .htaccess file is not part of the git repository anymore [annando, Quix0r]
Friendica Addons:
Update to the translations (CS, DE, EN-US, NL, PL, ZH-CN) [translation teams]
General update to adopt changes in core [annando, MrPetovan, Quix0r, tobiasd]
advancedcontentfilter:
Enhancement to the error handling [MrPetovan]
Honour the CSP settings [MrPetovan]
Fixed translation problems [annando]
blockem:
Enhancement of the settings [AlfredSK]
buffer:
support for app.net removed [annando]
js_upload:
Enhancement of the album name handling [rabuzarus]
Enhancement to the wording of the labels [astifter]
langfilter:
Fixed a problem with default values of the filtered languages [tobiasd]
libravatar:
The service wont shutdown, so we can keep the addon [tobiasd]
pumpio:
Fixed a problem that prevented new connections [annando]
superblock:
Fixed a bug that prevented the addon to block accounts [annando]
Enhancements of the settings [AlfredSK]
twitter:
Use rich text for quote tweets [MrPetovan]
Prevent empty quotes from being created [annando]
Fixed a problem with re-shares from remote_self contacts [annando]
Changed URL display after link expansion [MrPetovan]
Fixed a problem with EXIF handling [MrPetovan]
added addons:
mastodoncustomemojis [MrPetovan]
deprecated addons:
notimeline, retriver, remote_permissions, widgets
Directory:
Enhancements of the health summary [andyhee]
Enhancements of the PHP7 compatibility [MrPetovan]
Closed Issues:
901, 1034, 1074, 1303, 1308, 1391, 1490, 1470, 1559, 2093, 2337,
2340, 2381, 2396, 2675, 3291, 3299, 3493, 3501, 3535, 3643, 3840,
4148, 4419, 4475, 4507, 4655, 4659, 4710, 4726, 4739, 4753, 4814,
4830, 4868, 4889, 4923, 4971, 4950, 4985, 5066, 5099, 5137, 5148,
5158, 5168, 5188, 5202, 5211, 5222, 5233, 5243, 5247, 5252, 5257,
5260, 5262, 5268, 5274, 5275, 5276, 5278, 5298, 5318, 5319, 5320,
5321, 5322, 5330, 5333, 5341, 5365, 5405, 5407, 5411, 5423, 5432,
5434, 5436, 5443, 5455, 5464, 5467, 5469, 5486, 5496, 5497, 5514,
5539, 5524, 5541, 5544, 5550, 5564, 5566, 5605, 5630, 5638, 5651,
5653, 5660, 5670, 5691, 5733, 5745, 5768
Version 2018.05 (2018-06-01)
Friendica Core:
Update to the translations (DE, EN-GB, EN-US, FI, IS, IT, NL, PL, RU, ZN CH) [translation teams]

2
VERSION

@ -1 +1 @@
2018.08-dev
2018.09

2
boot.php

@ -39,7 +39,7 @@ require_once 'include/text.php';
define('FRIENDICA_PLATFORM', 'Friendica');
define('FRIENDICA_CODENAME', 'The Tazmans Flax-lily');
define('FRIENDICA_VERSION', '2018.08-dev');
define('FRIENDICA_VERSION', '2018.09');
define('DFRN_PROTOCOL_VERSION', '2.23');
define('DB_UPDATE_VERSION', 1283);
define('NEW_UPDATE_ROUTINE_VERSION', 1170);

3
composer.json

@ -18,13 +18,12 @@
"asika/simple-console": "^1.0",
"divineomega/password_exposed": "^2.4",
"ezyang/htmlpurifier": "~4.7.0",
"league/html-to-markdown": "~4.4.1",
"league/html-to-markdown": "~4.8.0",
"lightopenid/lightopenid": "dev-master",
"michelf/php-markdown": "^1.7",
"mobiledetect/mobiledetectlib": "2.8.*",
"paragonie/random_compat": "^2.0",
"pear/Text_LanguageDetect": "1.*",
"pear/Text_Highlighter": "dev-master",
"seld/cli-prompt": "^1.0",
"smarty/smarty": "^3.1",
"fxp/composer-asset-plugin": "~1.3",

237
composer.lock

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "d62c3e3d6971ee63a862a22ff3cd3768",
"content-hash": "5f6a43237dc52758484cd21cd76e8ce6",
"packages": [
{
"name": "asika/simple-console",
@ -483,16 +483,16 @@
},
{
"name": "league/html-to-markdown",
"version": "4.4.1",
"version": "4.8.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/html-to-markdown.git",
"reference": "82ea375b5b2b1da1da222644c0565c695bf88186"
"reference": "f9a879a068c68ff47b722de63f58bec79e448f9d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/82ea375b5b2b1da1da222644c0565c695bf88186",
"reference": "82ea375b5b2b1da1da222644c0565c695bf88186",
"url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/f9a879a068c68ff47b722de63f58bec79e448f9d",
"reference": "f9a879a068c68ff47b722de63f58bec79e448f9d",
"shasum": ""
},
"require": {
@ -511,7 +511,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.5-dev"
"dev-master": "4.9-dev"
}
},
"autoload": {
@ -524,17 +524,17 @@
"MIT"
],
"authors": [
{
"name": "Colin O'Dell",
"email": "colinodell@gmail.com",
"homepage": "http://www.colinodell.com",
"role": "Lead Developer"
},
{
"name": "Nick Cernis",
"email": "nick@cern.is",
"homepage": "http://modernnerd.net",
"role": "Original Author"
},
{
"name": "Colin O'Dell",
"email": "colinodell@gmail.com",
"homepage": "https://www.colinodell.com",
"role": "Lead Developer"
}
],
"description": "An HTML-to-markdown conversion helper for PHP",
@ -543,7 +543,7 @@
"html",
"markdown"
],
"time": "2017-03-16T00:45:59+00:00"
"time": "2018-09-18T12:18:08+00:00"
},
{
"name": "lightopenid/lightopenid",
@ -1669,204 +1669,6 @@
],
"time": "2018-02-15T05:50:20+00:00"
},
{
"name": "pear/console_getopt",
"version": "v1.4.1",
"source": {
"type": "git",
"url": "https://github.com/pear/Console_Getopt.git",
"reference": "82f05cd1aa3edf34e19aa7c8ca312ce13a6a577f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pear/Console_Getopt/zipball/82f05cd1aa3edf34e19aa7c8ca312ce13a6a577f",
"reference": "82f05cd1aa3edf34e19aa7c8ca312ce13a6a577f",
"shasum": ""
},
"type": "library",
"autoload": {
"psr-0": {
"Console": "./"
}
},
"notification-url": "https://packagist.org/downloads/",
"include-path": [
"./"
],
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "Greg Beaver",
"email": "cellog@php.net",
"role": "Helper"
},
{
"name": "Andrei Zmievski",
"email": "andrei@php.net",
"role": "Lead"
},
{
"name": "Stig Bakken",
"email": "stig@php.net",
"role": "Developer"
}
],
"description": "More info available on: http://pear.php.net/package/Console_Getopt",
"time": "2015-07-20T20:28:12+00:00"
},
{
"name": "pear/pear-core-minimal",
"version": "v1.10.3",
"source": {
"type": "git",
"url": "https://github.com/pear/pear-core-minimal.git",
"reference": "070f0b600b2caca2501e2c9b7e553016e4b0d115"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/070f0b600b2caca2501e2c9b7e553016e4b0d115",
"reference": "070f0b600b2caca2501e2c9b7e553016e4b0d115",
"shasum": ""
},
"require": {
"pear/console_getopt": "~1.4",
"pear/pear_exception": "~1.0"
},
"replace": {
"rsky/pear-core-min": "self.version"
},
"type": "library",
"autoload": {
"psr-0": {
"": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"include-path": [
"src/"
],
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Christian Weiske",
"email": "cweiske@php.net",
"role": "Lead"
}
],
"description": "Minimal set of PEAR core files to be used as composer dependency",
"time": "2017-02-28T16:46:11+00:00"
},
{
"name": "pear/pear_exception",
"version": "v1.0.0",
"source": {
"type": "git",
"url": "https://github.com/pear/PEAR_Exception.git",
"reference": "8c18719fdae000b690e3912be401c76e406dd13b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pear/PEAR_Exception/zipball/8c18719fdae000b690e3912be401c76e406dd13b",
"reference": "8c18719fdae000b690e3912be401c76e406dd13b",
"shasum": ""
},
"require": {
"php": ">=4.4.0"
},
"require-dev": {
"phpunit/phpunit": "*"
},
"type": "class",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-0": {
"PEAR": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"include-path": [
"."
],
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "Helgi Thormar",
"email": "dufuz@php.net"
},
{
"name": "Greg Beaver",
"email": "cellog@php.net"
}
],
"description": "The PEAR Exception base class.",
"homepage": "https://github.com/pear/PEAR_Exception",
"keywords": [
"exception"
],
"time": "2015-02-10T20:07:52+00:00"
},
{
"name": "pear/text_highlighter",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/pear/Text_Highlighter.git",
"reference": "2ccac2d9eaf55dc08bbbdb7136c93fb399d0f855"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pear/Text_Highlighter/zipball/2ccac2d9eaf55dc08bbbdb7136c93fb399d0f855",
"reference": "2ccac2d9eaf55dc08bbbdb7136c93fb399d0f855",
"shasum": ""
},
"require": {
"pear/pear-core-minimal": "~1.10.0",
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "@stable"
},
"type": "library",
"autoload": {
"psr-0": {
"Text": "./"
}
},
"include-path": [
"./"
],
"license": [
"PHP-3.01"
],
"authors": [
{
"email": "ssttoo@gmail.com",
"name": "Stoyan Stefanov",
"role": "Lead"
},
{
"email": "demenev@gmail.com",
"name": "Andrey Demenev",
"role": "Lead"
}
],
"description": "More info available on: http://pear.php.net/package/Text_Highlighter",
"support": {
"issues": "http://pear.php.net/bugs/search.php?cmd=display&package_name[]=Text_Highlighter",
"source": "https://github.com/pear/Text_Highlighter"
},
"time": "2018-01-27T08:24:15+00:00"
},
{
"name": "pear/text_languagedetect",
"version": "v1.0.0",
@ -3145,7 +2947,7 @@
}
],
"description": "Provides the functionality to compare PHP values for equality",
"homepage": "https://github.com/sebastianbergmann/comparator",
"homepage": "http://www.github.com/sebastianbergmann/comparator",
"keywords": [
"comparator",
"compare",
@ -3247,7 +3049,7 @@
}
],
"description": "Provides functionality to handle HHVM/PHP environments",
"homepage": "https://github.com/sebastianbergmann/environment",
"homepage": "http://www.github.com/sebastianbergmann/environment",
"keywords": [
"Xdebug",
"environment",
@ -3315,7 +3117,7 @@
}
],
"description": "Provides the functionality to export PHP variables for visualization",
"homepage": "https://github.com/sebastianbergmann/exporter",
"homepage": "http://www.github.com/sebastianbergmann/exporter",
"keywords": [
"export",
"exporter"
@ -3367,7 +3169,7 @@
}
],
"description": "Snapshotting of global state",
"homepage": "https://github.com/sebastianbergmann/global-state",
"homepage": "http://www.github.com/sebastianbergmann/global-state",
"keywords": [
"global state"
],
@ -3469,7 +3271,7 @@
}
],
"description": "Provides functionality to recursively process PHP variables",
"homepage": "https://github.com/sebastianbergmann/recursion-context",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"time": "2016-11-19T07:33:16+00:00"
},
{
@ -3669,8 +3471,7 @@
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"lightopenid/lightopenid": 20,
"pear/text_highlighter": 20
"lightopenid/lightopenid": 20
},
"prefer-stable": false,
"prefer-lowest": false,

2
doc/Developers-Intro.md

@ -33,7 +33,7 @@ If you don't want to translate the UI, or it is already done to your satisfactio
Are you good at designing things?
If you have seen Friendica you probably have ideas to improve it, haven't you?
* If you would like to work with us on enhancing the user interface, please join the [UX Watchdogs forum](https://fc.oscp.info/profile/ux-watchdogs)
* If you would like to work with us on enhancing the user interface, please join the [forum for Friendica development](https://forum.friendi.ca/profile/developers).
* Make plans for a better Friendica interface design and share them with us.
* Tell us if you are able to realize your ideas or what kind of help you need.
We can't promise we have the right skills in the group but we'll try.

2
doc/Quick-Start-groupsandpages.md

@ -15,6 +15,6 @@ Remember the link at the top of this page will bring you back here.
Once you've added some groups, <a href="help/Quick-Start-andfinally">move on to the next section</a>.
<iframe src="http://dir.friendica.com/directory/forum" width="950" height="600"></iframe>
<iframe src="http://dir.friendica.social/directory" width="950" height="600"></iframe>

2
doc/de/FAQ.md

@ -180,7 +180,7 @@ Hier ist eine Liste von Clients bei denen dies möglich ist, bzw. die speziell f
<a name="help"></a>
### Wo finde ich Hilfe?
Wenn Du Probleme mit Deiner Friendica-Seite hast, dann kannst Du die Community in der [Friendica-Support-Gruppe](https://forum.friendi.ca/profile/helpers) oder im [deutschen Friendica-Support-Forum](http://toktan.org/profile/wiki) fragen oder Dir das [deutsche Wiki](http://wiki.toktan.org/doku.php) anschauen.
Wenn Du Probleme mit Deiner Friendica-Seite hast, dann kannst Du die Community in der [Friendica-Support-Gruppe](https://forum.friendi.ca/profile/helpers) fragen oder Dir das [deutsche Wiki](https://friendica-wiki.de/) anschauen.
Wenn Du Deinen Account nicht nutzen kannst, kannst Du entweder einen [Testaccount](https://tryfriendica.de) bzw. einen Account auf einer öffentlichen Seite ([Liste](https://dir.friendica.social/servers)) nutzen.
Wenn du dir keinen weiteren Friendica Account einrichten willst, kannst du auch gerne über einen der folgenden alternativen Kanäle Hilfe suchen:

2
doc/de/Home.md

@ -61,7 +61,7 @@ Friendica - Dokumentation und Ressourcen
**Externe Ressourcen**
* [Haupt-Webseite](https://friendi.ca)
* [Deutsches Friendica-Wiki](http://wiki.toktan.org/doku.php)
* [Deutsches Friendica-Wiki](https://friendica-wiki.de)
* Support Kanäle
* [Friendica Support Forum](https://forum.friendi.ca/~helpers)
* [Mailing Listen Archiv](http://mailman.friendi.ca/mailman/listinfo/support-friendi.ca) zum Abonnieren der Liste eine E-Mail an ``support-request(at)friendi.ca?subject=subscribe`` senden

51
include/api.php

@ -581,7 +581,10 @@ function api_get_user(App $a, $contact_id = null)
if (is_null($user) && ($a->argc > (count($called_api) - 1)) && (count($called_api) > 0)) {
$argid = count($called_api);
if (!empty($a->argv[$argid])) {
list($user, $null) = explode(".", $a->argv[$argid]);
$data = explode(".", $a->argv[$argid]);
if (count($data) > 1) {
list($user, $null) = $data;
}
}
if (is_numeric($user)) {
$user = DBA::escape(api_unique_id_to_nurl(intval($user)));
@ -1056,10 +1059,10 @@ function api_statuses_mediap($type)
// now that we have the img url in bbcode we can add it to the status and insert the wall item.
$_REQUEST['body'] = $txt . "\n\n" . '[url=' . $picture["albumpage"] . '][img]' . $picture["preview"] . "[/img][/url]";
item_post($a);
$item_id = item_post($a);
// this should output the last post (the one we just posted).
return api_status_show($type);
// output the post that we just posted.
return api_status_show($type, $item_id);
}
/// @TODO move this to top of file or somewhere better!
@ -1075,7 +1078,6 @@ api_register_func('api/statuses/mediap', 'api_statuses_mediap', true, API_METHOD
*/
function api_statuses_update($type)
{
$a = get_app();
if (api_user() === false) {
@ -1129,8 +1131,8 @@ function api_statuses_update($type)
if ($throttle_day > 0) {
$datefrom = date(DateTimeFormat::MYSQL, time() - 24*60*60);
$condition = ["`uid` = ? AND `wall` AND `created` > ? AND `id` = `parent`", api_user(), $datefrom];
$posts_day = DBA::count('item', $condition);
$condition = ["`uid` = ? AND `wall` AND `created` > ?", api_user(), $datefrom];
$posts_day = DBA::count('thread', $condition);
if ($posts_day > $throttle_day) {
logger('Daily posting limit reached for user '.api_user(), LOGGER_DEBUG);
@ -1143,8 +1145,8 @@ function api_statuses_update($type)
if ($throttle_week > 0) {
$datefrom = date(DateTimeFormat::MYSQL, time() - 24*60*60*7);
$condition = ["`uid` = ? AND `wall` AND `created` > ? AND `id` = `parent`", api_user(), $datefrom];
$posts_week = DBA::count('item', $condition);
$condition = ["`uid` = ? AND `wall` AND `created` > ?", api_user(), $datefrom];
$posts_week = DBA::count('thread', $condition);
if ($posts_week > $throttle_week) {
logger('Weekly posting limit reached for user '.api_user(), LOGGER_DEBUG);
@ -1157,8 +1159,8 @@ function api_statuses_update($type)
if ($throttle_month > 0) {
$datefrom = date(DateTimeFormat::MYSQL, time() - 24*60*60*30);
$condition = ["`uid` = ? AND `wall` AND `created` > ? AND `id` = `parent`", api_user(), $datefrom];
$posts_month = DBA::count('item', $condition);
$condition = ["`uid` = ? AND `wall` AND `created` > ?", api_user(), $datefrom];
$posts_month = DBA::count('thread', $condition);
if ($posts_month > $throttle_month) {
logger('Monthly posting limit reached for user '.api_user(), LOGGER_DEBUG);
@ -1200,10 +1202,10 @@ function api_statuses_update($type)
}
// call out normal post function
item_post($a);
$item_id = item_post($a);
// this should output the last post (the one we just posted).
return api_status_show($type);
// output the post that we just posted.
return api_status_show($type, $item_id);
}
/// @TODO move to top of file or somewhere better
@ -1260,7 +1262,7 @@ api_register_func('api/media/upload', 'api_media_upload', true, API_METHOD_POST)
*
* @return array|string
*/
function api_status_show($type)
function api_status_show($type, $item_id = 0)
{
$a = get_app();
@ -1274,9 +1276,14 @@ function api_status_show($type)
$privacy_sql = "";
}
// get last public wall message
$condition = ['owner-id' => $user_info['pid'], 'uid' => api_user(),
'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT]];
if (!empty($item_id)) {
// Get the item with the given id
$condition = ['id' => $item_id];
} else {
// get last public wall message
$condition = ['owner-id' => $user_info['pid'], 'uid' => api_user(),
'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT]];
}
$lastwall = Item::selectFirst(Item::ITEM_FIELDLIST, $condition, ['order' => ['id' => true]]);
if (DBA::isResult($lastwall)) {
@ -1993,14 +2000,14 @@ function api_statuses_repeat($type)
$_REQUEST["source"] = api_source();
}
item_post($a);
$item_id = item_post($a);
} else {
throw new ForbiddenException();
}
// this should output the last post (the one we just posted).
// output the post that we just posted.
$called_api = [];
return api_status_show($type);
return api_status_show($type, $item_id);
}
/// @TODO move to top of file or somewhere better
@ -4396,7 +4403,7 @@ function save_media_to_database($mediatype, $media, $type, $album, $allow_cid, $
if ($filetype == "") {
$filetype=Image::guessType($filename);
}
$imagedata = getimagesize($src);
$imagedata = @getimagesize($src);
if ($imagedata) {
$filetype = $imagedata['mime'];
}

8
include/conversation.php

@ -229,12 +229,12 @@ function localize_item(&$item)
$xmlhead = "<" . "?xml version='1.0' encoding='UTF-8' ?" . ">";
$obj = XML::parseString($xmlhead.$item['object']);
$links = XML::parseString($xmlhead."<links>".unxmlify($obj->link)."</links>");
$Bname = $obj->title;
$Blink = "";
$Blink = $obj->id;
$Bphoto = "";
foreach ($links->link as $l) {
foreach ($obj->link as $l) {
$atts = $l->attributes();
switch ($atts['rel']) {
case "alternate": $Blink = $atts['href'];
@ -1454,7 +1454,7 @@ function get_responses(array $conv_responses, array $response_verbs, $ob, array
$ret = [];
foreach ($response_verbs as $v) {
$ret[$v] = [];
$ret[$v]['count'] = defaults($conv_responses[$v], $item['uri'], '');
$ret[$v]['count'] = defaults($conv_responses[$v], $item['uri'], 0);
$ret[$v]['list'] = defaults($conv_responses[$v], $item['uri'] . '-l', []);
$ret[$v]['self'] = defaults($conv_responses[$v], $item['uri'] . '-self', '0');
if (count($ret[$v]['list']) > MAX_LIKERS) {

3
include/items.php

@ -72,7 +72,8 @@ function add_page_info_data(array $data, $no_photos = false)
$text .= " title='".$data["title"]."'";
}
if (!empty($data["images"])) {
// Only embedd a picture link when it seems to be a valid picture ("width" is set)
if (!empty($data["images"]) && !empty($data["images"][0]["width"])) {
$preview = str_replace(["[", "]"], ["&#91;", "&#93;"], htmlentities($data["images"][0]["src"], ENT_QUOTES, 'UTF-8', false));
// if the preview picture is larger than 500 pixels then show it in a larger mode
// But only, if the picture isn't higher than large (To prevent huge posts)

55
include/text.php

@ -1911,58 +1911,3 @@ function format_network_name($network, $url = 0) {
return $network_name;
}
}
/**
* @brief Syntax based code highlighting for popular languages.
* @param string $s Code block
* @param string $lang Programming language
* @return string Formated html
*/
function text_highlight($s, $lang) {
if ($lang === 'js') {
$lang = 'javascript';
}
if ($lang === 'bash') {
$lang = 'sh';
}
// @TODO: Replace Text_Highlighter_Renderer_Html by scrivo/highlight.php
// Autoload the library to make constants available
class_exists('Text_Highlighter_Renderer_Html');
$options = [
'numbers' => HL_NUMBERS_LI,
'tabsize' => 4,
];
$tag_added = false;
$s = trim(html_entity_decode($s, ENT_COMPAT));
$s = str_replace(' ', "\t", $s);
/*
* The highlighter library insists on an opening php tag for php code blocks. If
* it isn't present, nothing is highlighted. So we're going to see if it's present.
* If not, we'll add it, and then quietly remove it after we get the processed output back.
*/
if ($lang === 'php' && strpos($s, '<?php') !== 0) {
$s = '<?php' . "\n" . $s;
$tag_added = true;
}
$renderer = new Text_Highlighter_Renderer_Html($options);
$factory = new Text_Highlighter();
$hl = $factory->factory($lang);
$hl->setRenderer($renderer);
$o = $hl->highlight($s);
$o = str_replace("\n", '', $o);
if ($tag_added) {
$b = substr($o, 0, strpos($o, '<li>'));
$e = substr($o, strpos($o, '</li>'));
$o = $b . $e;
}
return '<code>' . $o . '</code>';
}

47
mod/babel.php

@ -6,9 +6,11 @@
use Friendica\Content\Text;
use Friendica\Core\L10n;
function visible_lf($s)
function visible_whitespace($s)
{
return str_replace("\n", '<br />', $s);
$s = str_replace(' ', '&nbsp;', $s);
return str_replace(["\r\n", "\n", "\r"], '<br />', $s);
}
function babel_content()
@ -20,19 +22,19 @@ function babel_content()
$bbcode = trim($_REQUEST['text']);
$results[] = [
'title' => L10n::t('Source input'),
'content' => visible_lf($bbcode)
'content' => visible_whitespace($bbcode)
];
$plain = Text\BBCode::toPlaintext($bbcode, false);
$results[] = [
'title' => L10n::t('BBCode::toPlaintext'),
'content' => visible_lf($plain)
'content' => visible_whitespace($plain)
];
$html = Text\BBCode::convert($bbcode);
$results[] = [
'title' => L10n::t("BBCode::convert \x28raw HTML\x29"),
'content' => htmlspecialchars($html)
'title' => L10n::t('BBCode::convert (raw HTML)'),
'content' => visible_whitespace(htmlspecialchars($html))
];
$results[] = [
@ -43,13 +45,13 @@ function babel_content()
$bbcode2 = Text\HTML::toBBCode($html);
$results[] = [
'title' => L10n::t('BBCode::convert => HTML::toBBCode'),
'content' => visible_lf($bbcode2)
'content' => visible_whitespace($bbcode2)
];
$markdown = Text\BBCode::toMarkdown($bbcode);
$results[] = [
'title' => L10n::t('BBCode::toMarkdown'),
'content' => visible_lf($markdown)
'content' => visible_whitespace($markdown)
];
$html2 = Text\Markdown::convert($markdown);
@ -61,22 +63,33 @@ function babel_content()
$bbcode3 = Text\Markdown::toBBCode($markdown);
$results[] = [
'title' => L10n::t('BBCode::toMarkdown => Markdown::toBBCode'),
'content' => visible_lf($bbcode3)
'content' => visible_whitespace($bbcode3)
];
$bbcode4 = Text\HTML::toBBCode($html2);
$results[] = [
'title' => L10n::t('BBCode::toMarkdown => Markdown::convert => HTML::toBBCode'),
'content' => visible_lf($bbcode4)
'content' => visible_whitespace($bbcode4)
];
break;
case 'markdown':
$markdown = trim($_REQUEST['text']);
$results[] = [
'title' => L10n::t('Source input \x28Diaspora format\x29'),
'title' => L10n::t('Source input (Diaspora format)'),
'content' => '<pre>' . $markdown . '</pre>'
];
$html = Text\Markdown::convert($markdown);
$results[] = [
'title' => L10n::t('Markdown::convert (raw HTML)'),
'content' => htmlspecialchars($html)
];
$results[] = [
'title' => L10n::t('Markdown::convert'),
'content' => $html
];
$bbcode = Text\Markdown::toBBCode($markdown);
$results[] = [
'title' => L10n::t('Markdown::toBBCode'),
@ -86,7 +99,7 @@ function babel_content()
case 'html' :
$html = trim($_REQUEST['text']);
$results[] = [
'title' => L10n::t("Raw HTML input"),
'title' => L10n::t('Raw HTML input'),
'content' => htmlspecialchars($html)
];
@ -98,7 +111,13 @@ function babel_content()
$bbcode = Text\HTML::toBBCode($html);
$results[] = [
'title' => L10n::t('HTML::toBBCode'),
'content' => visible_lf($bbcode)
'content' => visible_whitespace($bbcode)
];
$markdown = Text\HTML::toMarkdown($html);
$results[] = [
'title' => L10n::t('HTML::toMarkdown'),
'content' => visible_whitespace($markdown)
];
$text = Text\HTML::toPlaintext($html);
@ -111,7 +130,7 @@ function babel_content()
$tpl = get_markup_template('babel.tpl');
$o = replace_macros($tpl, [
'$text' => ['text', L10n::t('Source text'), defaults($_REQUEST, 'text', ''), ''],
'$text' => ['text', L10n::t('Source text'), htmlentities(defaults($_REQUEST, 'text', '')), ''],
'$type_bbcode' => ['type', L10n::t('BBCode'), 'bbcode', '', defaults($_REQUEST, 'type', 'bbcode') == 'bbcode'],
'$type_markdown' => ['type', L10n::t('Markdown'), 'markdown', '', defaults($_REQUEST, 'type', 'bbcode') == 'markdown'],
'$type_html' => ['type', L10n::t('HTML'), 'html', '', defaults($_REQUEST, 'type', 'bbcode') == 'html'],

4
mod/bookmarklet.php

@ -30,6 +30,10 @@ function bookmarklet_content(App $a)
$page = normalise_link(System::baseUrl() . "/bookmarklet");
if (!strstr($referer, $page)) {
if (empty($_REQUEST["url"])) {
System::httpExit(400, ["title" => L10n::t('Bad Request')]);
}
$content = add_page_info($_REQUEST["url"]);
$x = [

25
mod/contacts.php

@ -47,6 +47,11 @@ function contacts_init(App $a)
if (!DBA::isResult($contact)) {
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => 0]);
}
// Don't display contacts that are about to be deleted
if ($contact['network'] == Protocol::PHANTOM) {
$contact = false;
}
}
if (DBA::isResult($contact)) {
@ -122,11 +127,12 @@ function contacts_init(App $a)
function contacts_batch_actions(App $a)
{
$contacts_id = $_POST['contact_batch'];
if (!is_array($contacts_id)) {
if (empty($_POST['contact_batch']) || !is_array($_POST['contact_batch'])) {
return;
}
$contacts_id = $_POST['contact_batch'];
$orig_records = q("SELECT * FROM `contact` WHERE `id` IN (%s) AND `uid` = %d AND `self` = 0",
implode(",", $contacts_id),
intval(local_user())
@ -367,7 +373,7 @@ function _contact_drop($orig_record)
return;
}
Contact::terminateFriendship($r[0], $orig_record);
Contact::terminateFriendship($r[0], $orig_record, true);
Contact::remove($orig_record['id']);
}
@ -595,17 +601,12 @@ function contacts_content(App $a, $update = 0)
/// @todo Only show the following link with DFRN when the remote version supports it
$follow = '';
$follow_text = '';
if (in_array($contact['network'], [Protocol::DIASPORA, Protocol::OSTATUS, Protocol::DFRN])) {
if (in_array($contact['rel'], [Contact::FRIEND, Contact::SHARING])) {
if (in_array($contact['rel'], [Contact::FRIEND, Contact::SHARING])) {
if (in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
$follow = System::baseUrl(true) . "/unfollow?url=" . urlencode($contact["url"]);
$follow_text = L10n::t("Disconnect/Unfollow");
} else {
$follow = System::baseUrl(true) . "/follow?url=" . urlencode($contact["url"]);
$follow_text = L10n::t("Connect/Follow");
}
}
if ($contact['uid'] == 0) {
} else {
$follow = System::baseUrl(true) . "/follow?url=" . urlencode($contact["url"]);
$follow_text = L10n::t("Connect/Follow");
}
@ -723,6 +724,8 @@ function contacts_content(App $a, $update = 0)
$sql_extra = " AND `blocked` = 0 ";
}
$sql_extra .= sprintf(" AND `network` != '%s' ", Protocol::PHANTOM);
$search = x($_GET, 'search') ? notags(trim($_GET['search'])) : '';
$nets = x($_GET, 'nets' ) ? notags(trim($_GET['nets'])) : '';

18
mod/dfrn_notify.php

@ -79,13 +79,13 @@ function dfrn_notify_post(App $a) {
$condition = [];
switch ($direction) {
case (-1):
$condition = ["`issued-id` = ? OR `dfrn-id` = ?", $dfrn_id, $dfrn_id];
$condition = ["(`issued-id` = ? OR `dfrn-id` = ?) AND `uid` = ?", $dfrn_id, $dfrn_id, $user['uid']];
break;
case 0:
$condition = ['issued-id' => $dfrn_id, 'duplex' => true];
$condition = ['issued-id' => $dfrn_id, 'duplex' => true, 'uid' => $user['uid']];
break;
case 1:
$condition = ['dfrn-id' => $dfrn_id, 'duplex' => true];
$condition = ['dfrn-id' => $dfrn_id, 'duplex' => true, 'uid' => $user['uid']];
break;
default:
System::xmlExit(3, 'Invalid direction');
@ -182,7 +182,7 @@ function dfrn_notify_post(App $a) {
function dfrn_dispatch_public($postdata)
{
$msg = Diaspora::decodeRaw([], $postdata);
$msg = Diaspora::decodeRaw([], $postdata, true);
if (!$msg) {
// We have to fail silently to be able to hand it over to the salmon parser
return false;
@ -287,15 +287,15 @@ function dfrn_notify_content(App $a) {
$condition = [];
switch ($direction) {
case (-1):
$condition = ["`issued-id` = ? OR `dfrn-id` = ?", $dfrn_id, $dfrn_id];
$condition = ["(`issued-id` = ? OR `dfrn-id` = ?) AND `uid` = ?", $dfrn_id, $dfrn_id, $user['uid']];
$my_id = $dfrn_id;
break;
case 0:
$condition = ['issued-id' => $dfrn_id, 'duplex' => true];
$condition = ['issued-id' => $dfrn_id, 'duplex' => true, 'uid' => $user['uid']];
$my_id = '1:' . $dfrn_id;
break;
case 1:
$condition = ['dfrn-id' => $dfrn_id, 'duplex' => true];
$condition = ['dfrn-id' => $dfrn_id, 'duplex' => true, 'uid' => $user['uid']];
$my_id = '0:' . $dfrn_id;
break;
default:
@ -322,8 +322,8 @@ function dfrn_notify_content(App $a) {
$encrypted_id = '';
$id_str = $my_id . '.' . mt_rand(1000,9999);
$prv_key = trim($importer['prvkey']);
$pub_key = trim($importer['pubkey']);
$prv_key = trim($importer['cprvkey']);
$pub_key = trim($importer['cpubkey']);
$dplx = intval($importer['duplex']);
if (($dplx && strlen($prv_key)) || (strlen($prv_key) && !strlen($pub_key))) {

2
mod/dirfind.php

@ -44,7 +44,7 @@ function dirfind_content(App $a, $prefix = "") {
$local = Config::get('system','poco_local_search');
$search = $prefix.notags(trim($_REQUEST['search']));
$search = $prefix.notags(trim(defaults($_REQUEST, 'search', '')));
$header = '';

144
mod/events.php

@ -20,7 +20,8 @@ use Friendica\Util\Temporal;
require_once 'include/items.php';
function events_init(App $a) {
function events_init(App $a)
{
if (!local_user()) {
return;
}
@ -42,7 +43,8 @@ function events_init(App $a) {
return;
}
function events_post(App $a) {
function events_post(App $a)
{
logger('post: ' . print_r($_REQUEST, true), LOGGER_DATA);
@ -50,15 +52,15 @@ function events_post(App $a) {
return;
}
$event_id = (x($_POST, 'event_id') ? intval($_POST['event_id']) : 0);
$cid = (x($_POST, 'cid') ? intval($_POST['cid']) : 0);
$event_id = !empty($_POST['event_id']) ? intval($_POST['event_id']) : 0;
$cid = !empty($_POST['cid']) ? intval($_POST['cid']) : 0;
$uid = local_user();
$start_text = escape_tags($_REQUEST['start_text']);
$finish_text = escape_tags($_REQUEST['finish_text']);
$start_text = escape_tags(defaults($_REQUEST, 'start_text', ''));
$finish_text = escape_tags(defaults($_REQUEST, 'finish_text', ''));
$adjust = intval($_POST['adjust']);
$nofinish = intval($_POST['nofinish']);
$adjust = intval(defaults($_POST, 'adjust', 0));
$nofinish = intval(defaults($_POST, 'nofinish', 0));
// The default setting for the `private` field in event_store() is false, so mirror that
$private_event = false;
@ -91,9 +93,9 @@ function events_post(App $a) {
// and we'll waste a bunch of time responding to it. Time that
// could've been spent doing something else.
$summary = escape_tags(trim($_POST['summary']));
$desc = escape_tags(trim($_POST['desc']));
$location = escape_tags(trim($_POST['location']));
$summary = escape_tags(trim(defaults($_POST, 'summary', '')));
$desc = escape_tags(trim(defaults($_POST, 'desc', '')));
$location = escape_tags(trim(defaults($_POST, 'location', '')));
$type = 'event';
$action = ($event_id == '') ? 'new' : "event/" . $event_id;
@ -117,7 +119,7 @@ function events_post(App $a) {
goaway($onerror_url);
}
$share = (intval($_POST['share']) ? intval($_POST['share']) : 0);
$share = intval(defaults($_POST, 'share', 0));
$c = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `self` LIMIT 1",
intval(local_user())
@ -137,7 +139,7 @@ function events_post(App $a) {
$str_contact_deny = !empty($_POST['contact_deny']) ? perms2str($_POST['contact_deny']) : '';
// Undo the pseudo-contact of self, since there are real contacts now
if (strpos($str_contact_allow, '<' . $self . '>') !== false ) {
if (strpos($str_contact_allow, '<' . $self . '>') !== false) {
$str_contact_allow = str_replace('<' . $self . '>', '', $str_contact_allow);
}
// Make sure to set the `private` field as true. This is necessary to
@ -187,8 +189,8 @@ function events_post(App $a) {
goaway($_SESSION['return_url']);
}
function events_content(App $a) {
function events_content(App $a)
{
if (!local_user()) {
notice(L10n::t('Permission denied.') . EOL);
return;
@ -244,7 +246,7 @@ function events_content(App $a) {
$mode = 'view';
$y = 0;
$m = 0;
$ignored = (x($_REQUEST, 'ignored') ? intval($_REQUEST['ignored']) : 0);
$ignored = !empty($_REQUEST['ignored']) ? intval($_REQUEST['ignored']) : 0;
if ($a->argc > 1) {
if ($a->argc > 2 && $a->argv[1] == 'event') {
@ -272,7 +274,6 @@ function events_content(App $a) {
// The view mode part is similiar to /mod/cal.php
if ($mode == 'view') {
$thisyear = DateTimeFormat::localNow('Y');
$thismonth = DateTimeFormat::localNow('m');
if (!$y) {
@ -312,10 +313,10 @@ function events_content(App $a) {
$finish = sprintf('%d-%d-%d %d:%d:%d', $y, $m, $dim, 23, 59, 59);
if ($a->argc > 1 && $a->argv[1] === 'json') {
if (x($_GET, 'start')) {
$start = $_GET['start'];
if (!empty($_GET['start'])) {
$start = $_GET['start'];
}
if (x($_GET, 'end')) {
if (!empty($_GET['end'])) {
$finish = $_GET['end'];
}
}
@ -349,7 +350,7 @@ function events_content(App $a) {
$r = Event::sortByDate($r);
foreach ($r as $rr) {
$j = $rr['adjust'] ? DateTimeFormat::local($rr['start'], 'j') : DateTimeFormat::utc($rr['start'], 'j');
if (!x($links,$j)) {
if (empty($links[$j])) {
$links[$j] = System::baseUrl() . '/' . $a->cmd . '#link-' . $j;
}
}
@ -363,12 +364,12 @@ function events_content(App $a) {
$events = Event::prepareListForTemplate($r);
}
if ($a->argc > 1 && $a->argv[1] === 'json'){
if ($a->argc > 1 && $a->argv[1] === 'json') {
echo json_encode($events);
killme();
}
if (x($_GET, 'id')) {
if (!empty($_GET['id'])) {
$tpl = get_markup_template("event.tpl");
} else {
$tpl = get_markup_template("events_js.tpl");
@ -378,7 +379,7 @@ function events_content(App $a) {
foreach ($events as $key => $event) {
$event_item = [];
foreach ($event['item'] as $k => $v) {
$k = str_replace('-' ,'_', $k);
$k = str_replace('-', '_', $k);
$event_item[$k] = $v;
}
$events[$key]['item'] = $event_item;
@ -403,7 +404,7 @@ function events_content(App $a) {
'$list' => L10n::t('list'),
]);
if (x($_GET, 'id')) {
if (!empty($_GET['id'])) {
echo $o;
killme();
}
@ -428,41 +429,45 @@ function events_content(App $a) {
}
// In case of an error the browser is redirected back here, with these parameters filled in with the previous values
if (x($_REQUEST, 'nofinish')) {$orig_event['nofinish'] = $_REQUEST['nofinish'];}
if (x($_REQUEST, 'adjust')) {$orig_event['adjust'] = $_REQUEST['adjust'];}
if (x($_REQUEST, 'summary')) {$orig_event['summary'] = $_REQUEST['summary'];}
if (x($_REQUEST, 'description')) {$orig_event['description'] = $_REQUEST['description'];}
if (x($_REQUEST, 'location')) {$orig_event['location'] = $_REQUEST['location'];}
if (x($_REQUEST, 'start')) {$orig_event['start'] = $_REQUEST['start'];}
if (x($_REQUEST, 'finish')) {$orig_event['finish'] = $_REQUEST['finish'];}
if (x($_REQUEST,'finish')) $orig_event['finish'] = $_REQUEST['finish'];
$n_checked = ((x($orig_event) && $orig_event['nofinish']) ? ' checked="checked" ' : '');
$a_checked = ((x($orig_event) && $orig_event['adjust']) ? ' checked="checked" ' : '');
$t_orig = (x($orig_event) ? $orig_event['summary'] : '');
$d_orig = (x($orig_event) ? $orig_event['desc'] : '');
$l_orig = (x($orig_event) ? $orig_event['location'] : '');
$eid = (x($orig_event) ? $orig_event['id'] : 0);
$cid = (x($orig_event) ? $orig_event['cid'] : 0);
$uri = (x($orig_event) ? $orig_event['uri'] : '');
if (!empty($_REQUEST['nofinish'])) {$orig_event['nofinish'] = $_REQUEST['nofinish'];}
if (!empty($_REQUEST['adjust'])) {$orig_event['adjust'] = $_REQUEST['adjust'];}
if (!empty($_REQUEST['summary'])) {$orig_event['summary'] = $_REQUEST['summary'];}
if (!empty($_REQUEST['description'])) {$orig_event['description'] = $_REQUEST['description'];}
if (!empty($_REQUEST['location'])) {$orig_event['location'] = $_REQUEST['location'];}
if (!empty($_REQUEST['start'])) {$orig_event['start'] = $_REQUEST['start'];}
if (!empty($_REQUEST['finish'])) {$orig_event['finish'] = $_REQUEST['finish'];}
$n_checked = (!empty($orig_event['nofinish']) ? ' checked="checked" ' : '');
$a_checked = (!empty($orig_event['adjust']) ? ' checked="checked" ' : '');
$t_orig = !empty($orig_event) ? $orig_event['summary'] : '';
$d_orig = !empty($orig_event) ? $orig_event['desc'] : '';
$l_orig = !empty($orig_event) ? $orig_event['location'] : '';
$eid = !empty($orig_event) ? $orig_event['id'] : 0;
$cid = !empty($orig_event) ? $orig_event['cid'] : 0;
$uri = !empty($orig_event) ? $orig_event['uri'] : '';
$sh_disabled = '';
$sh_checked = '';
$sh_checked = '';
if (x($orig_event)) {
$sh_checked = (($orig_event['allow_cid'] === '<' . local_user() . '>' && !$orig_event['allow_gid'] && !$orig_event['deny_cid'] && !$orig_event['deny_gid']) ? '' : ' checked="checked" ');
if (!empty($orig_event)
&& ($orig_event['allow_cid'] !== '<' . local_user() . '>'
|| $orig_event['allow_gid']
|| $orig_event['deny_cid']
|| $orig_event['deny_gid']))
{
$sh_checked = ' checked="checked" ';
}
if ($cid || $mode === 'edit') {
$sh_disabled = 'disabled="disabled"';
}
$sdt = (x($orig_event) ? $orig_event['start'] : 'now');
$fdt = (x($orig_event) ? $orig_event['finish'] : 'now');
$sdt = !empty($orig_event) ? $orig_event['start'] : 'now';
$fdt = !empty($orig_event) ? $orig_event['finish'] : 'now';
$tz = date_default_timezone_get();
if (x($orig_event)) {
if (!empty($orig_event)) {
$tz = ($orig_event['adjust'] ? date_default_timezone_get() : 'UTC');
}
@ -470,20 +475,22 @@ function events_content(App $a) {
$smonth = DateTimeFormat::convert($sdt, $tz, 'UTC', 'm');
$sday = DateTimeFormat::convert($sdt, $tz, 'UTC', 'd');
$shour = (x($orig_event) ? DateTimeFormat::convert($sdt, $tz, 'UTC', 'H') : '00');
$sminute = (x($orig_event) ? DateTimeFormat::convert($sdt, $tz, 'UTC', 'i') : '00');
$shour = !empty($orig_event) ? DateTimeFormat::convert($sdt, $tz, 'UTC', 'H') : '00';
$sminute = !empty($orig_event) ? DateTimeFormat::convert($sdt, $tz, 'UTC', 'i') : '00';
$fyear = DateTimeFormat::convert($fdt, $tz, 'UTC', 'Y');
$fmonth = DateTimeFormat::convert($fdt, $tz, 'UTC', 'm');
$fday = DateTimeFormat::convert($fdt, $tz, 'UTC', 'd');
$fhour = (x($orig_event) ? DateTimeFormat::convert($fdt, $tz, 'UTC', 'H') : '00');
$fminute = (x($orig_event) ? DateTimeFormat::convert($fdt, $tz, 'UTC', 'i') : '00');
$fhour = !empty($orig_event) ? DateTimeFormat::convert($fdt, $tz, 'UTC', 'H') : '00';
$fminute = !empty($orig_event) ? DateTimeFormat::convert($fdt, $tz, 'UTC', 'i') : '00';
$perms = ACL::getDefaultUserPermissions($orig_event);
if ($mode === 'new' || $mode === 'copy') {
$acl = ($cid ? '' : ACL::getFullSelectorHTML($a->user, false, $orig_event));
if (!$cid && in_array($mode, ['new', 'copy'])) {
$acl = ACL::getFullSelectorHTML($a->user, false, $orig_event);
} else {
$acl = '';
}
// If we copy an old event, we need to remove the ID and URI
@ -495,7 +502,7 @@ function events_content(App $a) {
$tpl = get_markup_template('event_form.tpl');
$o .= replace_macros($tpl,[
$o .= replace_macros($tpl, [
'$post' => System::baseUrl() . '/events',
'$eid' => $eid,
'$cid' => $cid,
@ -509,11 +516,31 @@ function events_content(App $a) {
'$title' => L10n::t('Event details'),
'$desc' => L10n::t('Starting date and Title are required.'),
'$s_text' => L10n::t('Event Starts:') . ' <span class="required" title="' . L10n::t('Required') . '">*</span>',
'$s_dsel' => Temporal::getDateTimeField(new DateTime(), DateTime::createFromFormat('Y', $syear+5), DateTime::createFromFormat('Y-m-d H:i', "$syear-$smonth-$sday $shour:$sminute"), L10n::t('Event Starts:'), 'start_text', true, true, '', '', true),
'$s_dsel' => Temporal::getDateTimeField(
new DateTime(),
DateTime::createFromFormat('Y', $syear+5),
DateTime::createFromFormat('Y-m-d H:i', "$syear-$smonth-$sday $shour:$sminute"),
L10n::t('Event Starts:'),
'start_text',
true,