Commit Graph

666 Commits

Author SHA1 Message Date
Roland Häder e06fc2aa69 Stopped using deprecated constants NETWORK_* (#5537)
* Rewrite:
- stopped using deprecated NETWORK_* constants, now Protocol::* should be used
- still left them intact for slow/lazy developers ...

* Removed deprecated NETWORK_* constants as per code reviewer's request.
2018-08-11 22:40:44 +02:00
Roland Häder 4d39164c1e [WIP] Rewrite to Proxy class: (#5507)
* Rewrite to Proxy class:
- introduced new Friendica\Network\Proxy class for in exchange of proxy_*()
  functions
- moved also all PROXY_* constants there as Proxy::*
- removed now no longer needed mod/proxy.php loading as composer's auto-load
  will do this for us
- renamed those proxy_*() functions to better names:
  + proxy_init()           -> Proxy::init()         (public)
  + proxy_url()            -> Proxy::proxifyUrl()   (public)
  + proxy_parse_html()     -> Proxy::proxifyHtml()  (public)
  + proxy_is_local_image() -> Proxy::isLocalImage() (private)
  + proxy_parse_query()    -> Proxy::parseQuery()   (private)
  + proxy_img_cb()         -> Proxy::replaceUrl()   (private)

* Ops, need to set $a here ...

* CR request:
- moved Proxy class to Friendica\Module
- extended BaseModule

* Ops, no need for own instance of $a when self::getApp() is around.

* Proxy-rewrite:
- proxy_url() and proxy_parse_html() are both non-module functions (now
  methods)
- so they must be splitted into a seperate class
- also the SIZE_* and DEFAULT_TIME constants are both not relevant to module

* No instances from utility classes

* Fixed error:
- proxify*() is now located in `Friendica\Util\ProxyUtils`

* Moved back to original place, ops? How did they move here? Well, it was not
intended by me.

* Removed duplicate (left-over from split) constants and static array. Thank to
MrPetovan finding it.

* Renamed ProxyUtils -> Proxy and aliased it back to ProxyUtils.
2018-07-30 22:06:22 -04:00
Roland Häder 37253656e3 Moved CONTACT_* constants to Friendica\Model\Contact class, lesser in global namespace (#5490)
* Rewrite:
- moved all CONTACT_* constants from boot.php to Contact class

* CR request:
- renamed Contact::CONTACT_IS_* -> Contact::* ;-)
2018-07-24 22:53:46 -04:00
Hypolite Petovan a6fb3568f9 Rename dbesc to DBA::escape 2018-07-23 15:30:54 -04:00
Hypolite Petovan ecea7425f8 Rename DBA::is_result to DBA::isResult 2018-07-23 11:04:14 -04:00
Hypolite Petovan 0ec44f3e8a Rename DBM method calls to DBA method calls 2018-07-23 11:02:24 -04:00
Hypolite Petovan af6dbc654f Rename Friendica\Database\dba to Friendica\Database\DBA 2018-07-20 08:19:26 -04:00
Hypolite Petovan daa1177e3a Update use statement lists with new Friendica\Database\dba class
- Remove unused use statement
- Remove superfluous use statements (classes in the same namespace)
- Add missing use statements
2018-07-19 22:15:21 -04:00
Michael Vogel 5af9596dde New item field "Post-type" and new table "permissionset" (#5408)
* "post-type" replaces "bookmark" and "type"

* Removed some more type

* Added index to permission set

* The permission set is now stored

* The permission set is now removed upon expiry

* Post update now stores the permission set

* New file

* Permissions are now sorted

* Changed documentation
2018-07-19 09:52:05 -04:00
Hypolite Petovan 67dc08d120 Enforce systen.register_policy value type 2018-07-16 19:38:19 -04:00
Hypolite Petovan 5906c7e013 Remove api test pconfig debug 2018-07-16 19:38:17 -04:00
Hypolite Petovan 224765cdf5 Wrong table name 2018-07-16 19:38:16 -04:00
Hypolite Petovan f8a90f3425 Add more api test debug 2018-07-16 19:38:16 -04:00
Hypolite Petovan de0afd3b32 Add api test debug 2018-07-16 19:38:16 -04:00
Michael Vogel 0360f7197a Several more warnings ... (#5340)
* Some more warnings removed

* Even more warnings ...

* Will it ever end? ;-)

* Avoid warning in dbstructure

* Origin and OStatus ...

* There are more warnings solved ... yeah!

* And again ...

* We are not done yet

* And more ...

* And some new places ...

* And more in the feeds

* Avoid some more

* And some backend stuff

* Notifications cleared

* Some more stuff

* and again ...

* It's getting fewer ...

* Some warnings had been hidden in the notifications

* Fix the fix

* And another missing one ...

* We need the owner here, not the user

* Forgotten user

* And more ...

* And some more warnings disappeared ...

* Some more frontend warnings

* Some backend warnings removed

* Fixed sidebar for "vier"

* And more ...

* Some more ...

* And something for "remote self"

* Am I stuck in an endless loop?

* Fix: Clear tag and file field on update

* Preset page content
2018-07-10 08:27:56 -04:00
Philipp Holzer c829e43725
moved get_guid to System::createGUID 2018-07-09 21:38:16 +02:00
Michael 3e797547a3 Warnings fixed 2018-07-08 09:37:05 +00:00
Michael Vogel ff5ee74ecf
Merge branch 'develop' into item-activities 2018-07-08 06:35:50 +02:00
Michael 4d35e228c4 More item abstraction / making remote deletion work again 2018-07-07 18:14:16 +00:00
Hypolite Petovan e44111e935 Revert renaming lang to language in api
- Normalize some quotes
- Put "Empty user-agent" log message in a else statement
2018-07-04 17:33:09 -04:00
Hypolite Petovan 43688c04b1 Add NotFoundException for recipients in api_direct_messages_new() 2018-07-02 07:48:59 -04:00
Hypolite Petovan cb7176ee70 Fix Config use in api_statusnet_config() 2018-07-02 07:48:53 -04:00
Hypolite Petovan 757fd357f6 Fix yet more undefined variable/index notice in api 2018-07-02 07:48:48 -04:00
Hypolite Petovan dde61a77a4 Fix root element containing only text in api_create_xml() 2018-07-02 07:48:42 -04:00
Hypolite Petovan 62eba48679 Fix yet more undefined variable/index messages in api_statuses_show 2018-07-02 07:48:38 -04:00
Hypolite Petovan a380bcd1c1 Fix more undefined variable/index notice in tests 2018-07-02 07:45:25 -04:00
Hypolite Petovan a329ce5b50 Fix $called_api expecting at least 2 elements in tests 2018-07-02 07:45:11 -04:00
Hypolite Petovan 6776c4e3f9 Fix some undefined variable/index notices in tests 2018-07-02 07:44:55 -04:00
Michael 028c9f4da5 We now store the verb in the item-content as well 2018-06-27 19:37:13 +00:00
Michael 76dab3b2d7 Use gravity instead of verb 2018-06-27 18:09:33 +00:00
Michael b03db4643f The fetch function now centrally controls the content 2018-06-24 10:48:29 +00:00
Michael d643e00d33 Standards and a new function to fetch content 2018-06-21 15:14:01 +00:00
Michael e4adaa9900 Standards and variable renaming 2018-06-19 17:11:59 +00:00
Michael a5ca724fd3 Merge remote-tracking branch 'upstream/develop' into more-abstraction 2018-06-19 13:48:19 +00:00
Michael 4714cb746b Use the item functions at many more places 2018-06-18 20:36:34 +00:00
Michael Vogel f828350ba2
Merge pull request #5234 from fabrixxm/fix/api
API: fix sender/recipient of PMs
2018-06-18 12:03:53 +02:00
fabrixxm e3ee9ee501 API: fix sender/recipient of PMs: check api_user before get user info.
To throw ForbiddenException and pass tests
2018-06-18 11:55:02 +02:00
Michael 507956818d Use the item classes where possible 2018-06-18 05:19:28 +00:00
fabrixxm c015bb1b77 API: fix sender/recipient of PMs 2018-06-17 19:57:32 +02:00
Michael 6e10de9284 New function to fetch item data especially for users 2018-06-17 17:05:17 +00:00
Michael 0280a46ab4 Use predefined field lists 2018-06-17 06:27:52 +00:00
Michael 14cb128264 New function for generating item URI 2018-06-16 06:44:19 +00:00
Michael defd3d15b6 Possibly fixed test 2018-06-09 20:39:40 +00:00
Michael b6c344a80a $r was still in use 2018-06-09 20:08:15 +00:00
Michael 50dfc7d36e Small query corrections 2018-06-09 19:27:44 +00:00
Michael 446a45003d Added documentation, some indention fixes 2018-06-09 19:12:13 +00:00
Michael baf316e898 The central item fetch does work now and the API now uses these functions 2018-06-09 16:56:37 +00:00
Michael e632be763c Corrected variable 2018-06-05 05:44:04 +00:00
Michael 18a77a1b45 Removed some quick and dirty hack to upload pictures 2018-06-05 05:42:26 +00:00
Michael 443d828ba7 We don't need to look for the uid 2018-06-03 10:29:42 +00:00
Michael 6985ad4fb5 Improved error message 2018-06-03 09:55:41 +00:00
Michael b654af28fa We need "global" 2018-06-03 09:40:32 +00:00
Michael ea498ff283 And a second SQL error fixed 2018-06-03 09:21:48 +00:00
Michael d76fb6d0b9 Fixed SQL error 2018-06-03 09:19:27 +00:00
Michael a720c4f501 Removed unneeded fields from the API 2018-06-03 07:22:01 +00:00
Hypolite Petovan 93daf7883e Merge branch 'master' into develop
- Updated new develop version label
- Incremented database build number
2018-06-01 07:30:04 -04:00
Michael 8329705eba New function to delete items for users 2018-05-29 05:22:57 +00:00
Michael 54136f3a74 Added the new parameter to the delete function. 2018-05-26 21:38:45 +00:00
Michael bdbc51229a Fix for not being able to delete items 2018-05-26 18:07:27 +00:00
Hypolite Petovan ce75177d4e
Merge pull request #5022 from Rudloff/feature/test_api
Add API tests
2018-05-16 08:25:11 -04:00
Roland Häder bacb7b70f6
Cleanups:
- added empty lines
- removed old-lost commented out line

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-05-14 22:50:05 +02:00
Roland Häder 94a02f8572
Continued:
- return is a keyword, not a function, so don't add braces here

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-05-14 22:50:05 +02:00
Roland Häder e0a07d5f27
Continued:
- used x() to make sure the array key is there, else an E_NOTICE is triggered
- added type-hints where it is safe

Signed-off-by: Roland Häder <roland@mxchange.org>
2018-05-14 22:50:04 +02:00
Roland Haeder 61fdc32d2f
Continued a bit:
- more spaces added
- more curly braces added
- let's use x($_FOO, 'bar') and not isset($_FOOT['bar'])

Signed-off-by: Roland Haeder <roland@mxchange.org>
2018-05-14 22:49:57 +02:00
Michael df019eb5bd Issue 4772: Display posts with uid=0 as well 2018-05-10 10:13:48 +00:00
Pierre Rudloff 9bb11ccfa5 $attachments should aways be an array
In order to avoid a PHP 7.2 error when using count()
2018-05-08 12:16:48 +02:00
Pierre Rudloff 23371880e8 $called_api should always be an array
In order to avoid a PHP 7.2 error when using count()
2018-05-08 12:16:48 +02:00
Michael 7cd7b1a9bf Some more replaced queries 2018-05-04 21:43:29 +00:00
Michael a83970bc0e Some more dba stuff 2018-05-04 06:33:36 +00:00
Michael 4ad655ab80 Replace old database queries with the new ones 2018-05-02 19:26:15 +00:00
Pierre Rudloff f3d98b2864 api_get_user() should not return false right away if the number in the URL is not a valid user 2018-04-10 10:46:10 +02:00
Pierre Rudloff 7d953d952e Various small fixes (#4795)
* Use strict comparison to avoid 0 == false
* Avoid unecessary loop
* Avoid undefined variable
* Fix wrong variable name
* Don't try to use the $status_info variable if it does not exist
* Avoid undefined variable
* Check that variable is defined before trying to use it
* Don't cast $data array to boolean
* Fix undefined array
* $reactivate_group variable is not always defined
* Variable $found is not always defined
* Remove unused return statement
* Fix undefined array
* api_unique_id_to_nurl() requires an integer as argument
* Don't try to use $uinfo if it is false
* Don't use the same variable names in inner loop
* Throw an exception if $fileext is not defined
2018-04-09 15:34:53 -04:00
Pierre Rudloff 773591a6ba Add some missing return types 2018-04-09 19:53:02 +02:00
Pierre Rudloff 4b36f3ad05 api_format_data() seems to never return an object 2018-04-09 19:34:09 +02:00
Pierre Rudloff 9cde7881ee Throw a ForbiddenException if api_get_user() returns false 2018-04-09 18:52:38 +02:00
Pierre Rudloff d0591dd882 The first argument for api_format_items() must be an array 2018-04-08 01:06:40 +02:00
Pierre Rudloff 9c351bad68 Fix wrong use of empty() 2018-04-08 00:55:05 +02:00
Pierre Rudloff bef3799942 Use empty() instead of !x() 2018-04-07 23:21:51 +02:00
Pierre Rudloff 333eb5f9dd Add missing variable 2018-04-07 23:20:30 +02:00
Pierre Rudloff b775cba8c2 Remove confusing comment 2018-04-07 22:39:38 +02:00
Pierre Rudloff 036803d8c7 Typo 2018-04-07 22:37:57 +02:00
Pierre Rudloff 5d8d62015c Make list_id parameter mandatory in api/lists/statuses 2018-04-07 22:36:54 +02:00
Pierre Rudloff 6401eb988b Use dba to access database in api_lists_statuses() 2018-04-07 22:35:19 +02:00
Pierre Rudloff fea7ec2482 We don't need type casting for dba::select() arguments 2018-04-07 22:18:39 +02:00
Pierre Rudloff c5aaa61d11 Rename api_list_create() to api_lists_create() for consistency 2018-04-07 22:15:35 +02:00
Pierre Rudloff c4edad212b Use dba to access the database in list API functions 2018-04-07 19:55:41 +02:00
Pierre Rudloff 929440417c We don't really need the unsen bit in api_lists_statuses() 2018-04-07 19:52:47 +02:00
Pierre Rudloff b3235c2d02 Implement parts of the list API:
lists/statuses
lists/destroy
lists/update
lists/create
lists/ownerships
2018-04-07 19:16:47 +02:00
Pierre Rudloff 78a979ee58 Add profile_image_url_profile_size and profile_image_url_large properties to user object returned by API (fixes #4695)
This allows some clients to display a bigger avatar on profiles.
2018-04-07 13:31:17 +02:00
Hypolite Petovan 27d94023ee Merge branch 'master' into develop 2018-03-23 06:15:55 -04:00
Hypolite Petovan 789561c7a2 Remove/Update references to include/html2*.php 2018-03-07 16:34:17 -05:00
Hypolite Petovan 5e806ff598 Replace html2plain calls by HTML::toPlaintext 2018-03-07 16:29:44 -05:00
Hypolite Petovan b5666bd27f Replace html2bbcode calls by HTML::toBBCode 2018-03-07 16:24:13 -05:00
Hypolite Petovan 95752b79e8 Add cache performance to API and worker 2018-03-04 23:13:19 -05:00
Michael 506f851b23 Bugfix: Avoid that Twidere is crashing 2018-03-04 19:25:02 +00:00
Michael a3af6807ac Improved resource id creation 2018-02-20 10:02:07 +00:00
Hypolite Petovan 9e3bae5caa Remove references to include/bbcode.php 2018-02-14 22:01:14 -05:00
Hypolite Petovan 0c52866693 Refactor bbcode() into BBCode::convert() 2018-02-14 21:33:55 -05:00
rabuzarus 26fd6b1c33 fix undeclared variables or wrong variable names (/include) 2018-02-11 22:13:29 +01:00
Michael 30cfca40d8 Use a more simple HTML for API output 2018-02-10 13:33:15 +00:00
Tobias Diekershoff 85c8bf0228
Merge pull request #4399 from MrPetovan/task/3878-move-include-bbcode-to-src
Move include/bbcode to src/ part 1 : Everything but bbcode()
2018-02-07 07:18:39 +01:00
Michael e609de2957 Many item calls are now isolated in a single function 2018-02-06 12:40:22 +00:00
Hypolite Petovan 010cf3b1e8 Update references to BBCode methods
- Resolve name conflicts with Util\Network
2018-02-04 19:26:22 -05:00
Hypolite Petovan f020292408 Remove references to include/datetime 2018-02-03 20:47:37 -05:00
Hypolite Petovan 5e7285b9ba Move Temporal::convert() to DateTimeFormat::convert() 2018-02-03 08:56:55 -05:00
Hypolite Petovan 35d06bd9eb Add Temporal::utc() shorthand to Temporal::convert() 2018-02-03 08:56:53 -05:00
Hypolite Petovan 8aff8a76eb Add Temporal::utcNow() 2018-02-03 08:56:52 -05:00
Hypolite Petovan 38ff1b455b Add Temporal::MYSQL constant
- Rename Temporal::convert() parameter names
2018-02-03 08:56:52 -05:00
Hypolite Petovan b854905150 Move ATOM_TIME to Temporal::ATOM 2018-02-03 08:56:52 -05:00
Hypolite Petovan dc366bf1f7 Refactor datetime_convert into Temporal::convert
- Changed parameter order to save space
- Refactor select_timezone into Temporal::getTimezoneSelect
- Refactor field_timezone into Temporal::getTimezoneField
2018-02-03 08:56:51 -05:00
Hypolite Petovan 974539913c Remove include/like references 2018-02-01 14:17:22 -05:00
Hypolite Petovan a286e8bf3b Replace do_like() calls 2018-02-01 14:17:08 -05:00
Michael 7b27dda784 Most functions now moved from include/items.php 2018-01-28 11:18:08 +00:00
Adam Magness f04d40a37e Review update
Rename function, move others
2018-01-27 11:13:41 -05:00
Adam Magness c67452f72e Move fetch_url
move fetch_url function
2018-01-26 23:09:48 -05:00
Adam Magness 177edd2b6e Rename class to BBCode
Rename Plaintext class to BBCode
2018-01-26 20:01:32 -05:00
Adam Magness 21881f2885 Update function calls
update to new function calls
2018-01-26 19:14:47 -05:00
Adam Magness 8eecad4c7f String correction
monthly is monthly
2018-01-23 22:43:22 -05:00
Adam Magness 5142e65726 Review updates
improve a t() call and move some to tt()
2018-01-23 22:38:47 -05:00
Adam Magness 208a149a7b Review sprintf
remove more sprintf calls
2018-01-23 21:59:16 -05:00
Adam Magness c8ecc31405 Update functions and calls
Update function names and calls.
2018-01-22 18:03:26 -05:00
Adam Magness b86b04a81a Change plugin to addon
change the use of plugin to addon where appropriate.
2018-01-20 07:48:22 -05:00
Adam Magness 11cf36105c Update Addon functions and calls
Update function names and calls for Addon class.
2018-01-20 07:48:22 -05:00
Michael 034d46196f "last-child" is not used anymore 2018-01-18 06:54:44 +00:00
Michael 2d66242b4f The delete function is now changed to the new function 2018-01-17 23:22:01 +00:00
Hypolite Petovan e36f2bb1fb Use short form array syntax everywhere
- Add short form array syntax to po2php.php generation
2018-01-15 14:07:17 -05:00
Adam Magness b3e6a1d283 Update functions and calls
Update functions and calls.
2018-01-15 12:14:09 -05:00
fabrixxm 2d0fe7a30f
Fix api login 2018-01-13 09:22:40 +01:00
Hypolite Petovan 5fc4927764 Improve dba::selectFirst calls
- Fix remaining $r[0] references
- Rename $r to meaningful names
2018-01-11 03:43:57 -05:00
Hypolite Petovan ae66bcaff3 Rename selectOne to selectFirst 2018-01-10 12:57:21 -05:00
Hypolite Petovan da60893590 Replace dba::select(limit => 1) by dba::selectOne
- Convert array declarations to new style
2018-01-10 12:57:21 -05:00
Adam Magness a3ef9e35ec Update functions and calls
Update function names and calls.
2018-01-09 22:42:04 -05:00
Hypolite Petovan d1b3b7fbe4 Review changes
- Remove doc for unused config value
- Restore api_get_user($a) calls
2018-01-04 13:26:09 -05:00
Hypolite Petovan 35a18f6825 Fix unused code in include (second pass) 2018-01-04 12:21:13 -05:00
Hypolite Petovan 3b4625ebdd Fix unused code in include/api 2018-01-04 12:19:06 -05:00
Hypolite Petovan b39e06ed23
Merge pull request #4136 from Rudloff/feature/update_profile_api
Cleaner way to get user URL in api_account_update_profile
2017-12-26 17:13:58 -06:00
Pierre Rudloff 8b10bfe3a8 Cleaner way to get user URL in api_account_update_profile 2017-12-26 21:50:08 +01:00
Hypolite Petovan 06f32aaaa6
Merge pull request #4130 from Rudloff/feature/update_profile_api
Basic support for account/update_profile API (fixes #4094)
2017-12-25 20:06:34 -05:00
Pierre Rudloff c490a718ac Update profile in directory when calling api_account_update_profile 2017-12-26 01:09:51 +01:00
Pierre Rudloff 94244024ac Improve conditions in api_account_update_profile 2017-12-26 01:05:12 +01:00
Pierre Rudloff 8c17b96749 Missing return types in docblocks 2017-12-25 21:14:02 +01:00
Pierre Rudloff ee5301018a Fix typo 2017-12-25 21:12:08 +01:00
Pierre Rudloff de5dae0751 Basic support for account/update_profile API (fixes #4094) 2017-12-25 21:10:26 +01:00
Hypolite Petovan 75ba84efa8
Merge pull request #4129 from annando/issue-4121
API: Better use "about" instead of "pdesc"
2017-12-25 09:23:46 -05:00
Michael 0475fc1fce API: Better use "about" instead of "pdesc" 2017-12-25 05:39:11 +00:00
Hypolite Petovan c6a00f5ac4
Merge pull request #4126 from annando/issue-4121
Fix for issue 4121 - now the description isn't empty
2017-12-24 21:19:21 -05:00
Michael ba4329da61 Fixed typo 2017-12-24 23:07:14 +00:00
Pierre Rudloff 37eecad8cc Add missing doc in api.php 2017-12-24 15:01:43 +01:00
Michael e848e376b8 Fix for issue 4121 - now the description isn't empty 2017-12-24 11:51:38 +00:00
Pierre Rudloff 0305aa2d82 Lint api.php 2017-12-24 00:27:45 +01:00