Commit Graph

48 Commits

Author SHA1 Message Date
Andrew Dolgov 865ecc8796
move to psr-4 autoloader 2023-10-25 12:55:09 +03:00
jmechnich 560caf8377 Fix PHP8 strtime warning if argument is null (addendum) 2022-10-01 11:05:12 +02:00
wn_ 3487c922b3 Replace use of 'array_merge' with the spread operator and 'array_push' in various places.
This isn't supported for arrays with string keys until PHP 8.1.

https://wiki.php.net/rfc/spread_operator_for_array
2022-08-12 17:58:38 +00:00
Andrew Dolgov 26c67dba77
update phpstan to 1.8.2 2022-07-31 13:55:09 +03:00
David Edler de1e218a83
various fixes vor php 8.1 compatibility
Cherry-picked from https://git-gitea.tt-rss.org/fox/tt-rss/pulls/56,
while excluding changes in vendor/ (causes compatiblity issues with
PHP<8 [1]) and strftime-related ones (already re-applied in
https://git-gitea.tt-rss.org/fox/tt-rss/pulls/66).

[1] https://community.tt-rss.org/t/support-for-php-8-1/5089/9
2022-03-09 00:46:15 +08:00
Andrew Dolgov a201e10ee0 Revert "various fixes vor php 8.1 compatibility"
This reverts commit 14027ae04e.
2021-12-01 13:37:35 +03:00
David Edler 14027ae04e various fixes vor php 8.1 compatibility 2021-11-30 21:50:09 +01:00
wn_ 78acf18b70 Address PHPStan warnings in FeedItem classes. 2021-11-15 02:40:45 +00:00
Andrew Dolgov dff479af64 feeditem_atom: support xml:base for enclosures and entry content
UrlHelper::rewrite_relative: use base URL path if relative url path is not absolute (experimental)
2021-05-21 15:39:41 +03:00
Andrew Dolgov e8e6329040 rename unfairly prefixed get_enclosures() in feeditem 2021-03-05 09:35:24 +03:00
Andrew Dolgov 257efb43c6 article: unify naming 2021-02-15 15:52:28 +03:00
Andrew Dolgov 304d3a0b88 tag-related fixes
1. move tag sanitization to feedparser common item class
2. enforce length limit on tags when parsing
3. support multiple tags passed via one dc:subject and other such elements, parse them as a comma-separated list
4. sort resulting tag list to prevent different order between feed updates
5. remove some duplicate code related to tag validation
6. allow + symbol in tags
2019-11-20 18:56:34 +03:00
Andrew Dolgov 55ef85adc0 parser: clean() attribute values by default (except content) 2018-12-26 10:16:11 +03:00
Andrew Dolgov 54727f9534 parser: move media:element handling to feeditem_common; use media:content @media attribute to generate placeholder content-type if not specified 2018-08-21 07:01:26 +03:00
Andrew Dolgov eb43d9f4a8 fix previous to not crash if document first child is not a DOMElement or whatever 2018-08-12 19:27:04 +03:00
Tobias Kappé a377d5c981 Determine language for atom entry without a loop. 2018-08-12 16:17:13 +01:00
Tobias Kappé 22a866edb5 Store language of entries as indicated by the feed. 2018-08-12 15:27:26 +01:00
wn_ f3774b9d65 Use 'saveHTML' when generating HTML from a DOMDocument.
This primarily occurs when modifying article content.  If 'saveXML' is
used following 'loadHTML' there is the possibility of strangeness, such
as a self-closing anchor tag.

Note that the DOMDocument used in 'classes/feeditem/atom.php' came from
'loadXML', but we use 'saveHTML' since we're returning HTML content.
2017-09-09 13:51:59 -05:00
Andrew Dolgov ea79a0e033 remove some redundant php closing tags 2017-04-26 20:24:18 +03:00
Andrew Dolgov 7d1e15c396 parser: properly support tag subtrees instead of text content for article content 2016-01-23 01:48:32 +03:00
Andrew Dolgov d2bb392bae Revert "parser: use node->c14n() instead of expecting html in nodeValue"
This reverts commit 1383514ad9.
2016-01-23 01:24:13 +03:00
Andrew Dolgov 1383514ad9 parser: use node->c14n() instead of expecting html in nodeValue 2016-01-23 01:04:24 +03:00
Felix Eckhofer 523bd90baf Store size of enclosure to database 2014-07-15 16:23:46 +02:00
Andrew Dolgov 31bd6f7643 parser: trim some some feed-extracted data link titles and links 2014-03-04 16:38:04 +04:00
Andrew Dolgov 2ab7ccb695 parser: fix failing on empty media:group tags 2014-01-12 08:53:30 +04:00
Andrew Dolgov e23aedd402 parser: add basic support for media:thumbnail 2013-12-15 12:35:30 +04:00
Jeffrey Tolar ed449a9aaa Follow the spec for <media:group>s
Each <media:group> section specifies multiple representations of the
same content.
2013-11-17 17:58:43 -06:00
Andrew Dolgov 5c54e68388 support media:description for media: enclosures 2013-08-05 12:26:09 +04:00
Andrew Dolgov 6bf61bdc63 simplify media:content xpath 2013-08-05 11:50:15 +04:00
Andrew Dolgov 4289b68f0d parser: support media:content elements within media:group 2013-08-05 10:33:13 +04:00
Andrew Dolgov 491ef97072 atom: only perform xml:base based rewriting if base element exists (closes #761) 2013-07-29 16:16:47 +04:00
Andrew Dolgov 3c4dead676 atom: remove rel2abs; use rewrite_relative_url 2013-07-11 14:21:29 +04:00
syrnon 6aeb37d062 fixing the rel url to abs 2013-07-09 18:05:16 +03:00
syrnon b28b2ce9eb calculating base locally 2013-07-09 17:29:25 +03:00
syrnon bfc24f3794 Update atom.php 2013-07-03 22:36:33 +03:00
Andrew Dolgov bc3c887f4f better root element detection for atom content type xhtml (closes #720) 2013-06-20 21:16:06 +04:00
Andrew Dolgov d256f1fbd8 atom: support <published> 2013-06-10 13:25:34 +04:00
Andrew Dolgov ce5d234d63 support dc:date elements in rss and atom feeds 2013-06-01 09:49:56 +04:00
Andrew Dolgov df2655e015 better support for atom:link elements in rss feeds, support rel=standout (fuck you google and your nonstandard shit) 2013-05-26 10:21:54 +04:00
Andrew Dolgov 2700440178 better support for atom content type xhtml 2013-05-16 09:19:56 +04:00
Andrew Dolgov 96ce71f35f atom parser: experimental fix for feeds which do not encode entry content 2013-05-15 23:06:56 +04:00
Andrew Dolgov 72c29b65d4 atom: fix rel=alternate links 2013-05-02 10:40:59 +04:00
Andrew Dolgov b4d1690097 move common methods to feeditem_common 2013-05-01 21:06:48 +04:00
Andrew Dolgov f11015058d support dc:creator 2013-05-01 21:01:30 +04:00
Andrew Dolgov d4992d6b48 add support for dc:subject and slash:comments 2013-05-01 20:55:08 +04:00
Andrew Dolgov 4c00e15b5d pass xpath object to feeditem, support media-rss objects 2013-05-01 19:40:43 +04:00
Andrew Dolgov 04d2f9c831 add basic rss support 2013-05-01 17:38:16 +04:00
Andrew Dolgov cd07592c29 add basic tinyparser/atom 2013-05-01 17:04:57 +04:00