aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Helper/ContentProxy.php
Commit message (Collapse)AuthorAgeFilesLines
* phpcsKevin Decherf2018-10-241-1/+2
| | | | Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* updateOriginUrl: remove 'query string' case from ignore listKevin Decherf2018-10-241-2/+0
| | | | | | | Two urls with a different query string may refer to two different pages so keep them both. Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* updateOriginUrl: add comment blocks for the parse_url diff checkKevin Decherf2018-10-241-0/+23
| | | | Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* updateOriginUrl: rewrite some if, resolving feedbacks from PRKevin Decherf2018-10-241-32/+35
| | | | Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* ignoreOriginUrl: add initial support of ignore listsKevin Decherf2018-10-221-20/+59
| | | | | | | | | | | Add the ability to specify hosts and patterns lists to ignore the given entry url and replace it with the fetched content url without touching to origin_url. This initial support should be reworked in the following months to move the hardcoded ignore lists in the database. Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* updateOriginUrl: add behavior when diff is fragment and queryKevin Decherf2018-10-221-0/+1
| | | | Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* Refactor updateOriginUrl to include new behaviors behaviorsKevin Decherf2018-10-221-9/+45
| | | | | | | | - Leave origin_url unchanged if difference is an ending slash - Leave origin_url unchanged if difference is scheme - Ignore (noop) if difference is query string or fragment Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* ContentProxy: swap entry url to origin_url and set new url according to ↵Kevin Decherf2018-10-211-4/+11
| | | | | | | | graby content Closes #3529 Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* ContentProxy: fix a corner case when entry.url is empty in updateEntryKevin Decherf2018-10-211-0/+8
| | | | Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* Run php-cs-fixer for fixing coding standard issuesTobi8232018-09-231-41/+53
|
* Override the value of the given parameter ($title) with the (hopefully)Tobi8232018-09-211-2/+1
| | | | correct (to UTF-8) converted PDF title
* Add tests for logicTobi8232018-09-211-2/+2
| | | | Try to translate the title of a PDF from UTF-8 (then UTF-16BE, then WINDOWS-1252) to UTF-8
* Try to detect the character encoding in PDFs and try to translateTobi8232018-09-211-13/+33
| | | | the title from the PDF to UTF-8
* Remove type declaration for PHP 5 compatibilityTobi8232018-09-211-1/+1
|
* Bugfix: Sanitize the title of a saved webpage from invalid UTF-8 charactersTobi8232018-09-211-0/+23
|
* php-cs-fixerKevin Decherf2018-09-051-4/+4
| | | | Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* Fix empty title and domain_name when exception is thrown during fetchKevin Decherf2017-12-131-4/+33
| | | | | | | | | | Add a new helper to set a default title when it's empty: 1/ use basename part of entry's path, if any 2/ or use domain name Fixes #2053 Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* Define storeArticleHeaders false by defaultJeremy Benoist2017-11-211-1/+1
| | | | | Fix tests which must use `$storeArticleHeaders`. Fix CS
* Added internal setting to enable/disable headers storageNicolas Lœuillet2017-11-201-2/+4
|
* CSJeremy Benoist2017-10-091-1/+1
|
* Add a test for updatePublishedAtJeremy Benoist2017-07-241-3/+9
| | | | | | | To avoid error when a content is re-submitted and it previously add a published date. Also, fix the `testPostSameEntry`
* Fix updatePublishedAt on already parsed article's dateSimounet2017-07-241-1/+1
|
* CSJeremy Benoist2017-07-031-70/+70
|
* Fix validateAndSetPreviewPictureJeremy Benoist2017-07-031-4/+1
| | | | Which wasn't covered by a test!
* Fix PATCH methodJeremy Benoist2017-07-031-37/+52
| | | | | The PATCH method for the entry should only update what user sent to us and not the whole entry as it was before. Also, sending tags when patching an entry will now remove all current tags & assocatied new ones.
* Add a real configuration for CS-FixerJeremy Benoist2017-07-011-5/+5
|
* Fix empty language and preview picsThomas Citharel2017-06-121-2/+2
|
* Convert - to _ in languageJeremy Benoist2017-06-091-0/+4
| | | | Mostly to increase language supports
* Use Locale instead of LanguageJeremy Benoist2017-06-091-2/+2
|
* CSJeremy Benoist2017-06-081-1/+2
|
* Validate language & preview picture fieldsJeremy Benoist2017-06-081-11/+67
| | | | | Instead of saving the value of each field right into the content without any validation, it seems better to validate them. This might sounds obvious now we say that.
* Add ability to patch an entry with more fieldsJeremy Benoist2017-06-021-1/+1
| | | | | | | | | Like when we create an entry, we can now patch an entry with new fields: - content - language - preview_picture - published_at - authors
* No need to catch that ExceptionJeremy Benoist2017-06-011-9/+2
|
* Rewrote code & fix testsJeremy Benoist2017-06-011-46/+20
|
* CSJeremy Benoist2017-06-011-3/+3
|
* Fix testsJeremy Benoist2017-06-011-8/+19
|
* Add disableContentUpdate import optionJerome Charaoui2017-06-011-22/+54
| | | | | | This commit also decouples the "import" and "update" functions inside ContentProxy. If a content array is available, it must be passed to the new importEntry method.
* Avoid returning objects passed by reference.Jerome Charaoui2017-06-011-4/+0
| | | | | | Objects are always passed by reference, so it doesn't make sense to return an object which is passed by reference as it will always be the same object. This change makes the code a bit more readable.
* Forced date can now be a timestamp tooJeremy Benoist2017-05-311-1/+8
| | | | Add adding more tests for forced content
* Improve docsJeremy Benoist2017-05-311-3/+3
|
* Remove htmlawed and use graby insteadJeremy Benoist2017-05-311-18/+1
| | | | | Instead of using htmlawed (which is already used in graby) use graby directly (which require some refacto on graby side). Still needs some tests.
* Use graby ContentExtractor to clean htmlJeremy Benoist2017-05-311-0/+10
| | | | It might be better to re-use some graby functionalities to clean html instead of building a new system.
* Allow other fields to be send using APIJeremy Benoist2017-05-311-7/+23
| | | | | | | | | | | | | | | | Entry API can now have these new fields: - content - language - preview_picture - published_at Re-use the ContentProxy to be able to do the same using the web UI (in the future). htmLawed is used to clean stuff from content, I hope it’ll be enough to avoid security breach. Lower content validation when we want to update an entry with content already defined. Before, language & content_type were required. If there weren’t provided, we re-fetched the content using graby. I think these fields aren’t required for an entry to be created. So I removed them. Which means some import from the v1 export won’t be re-fetched since they provide content, url & title. Also, remove liberation link from Readability import to avoid overlaping import (from wallabag v1, which had the same link)
* CSThomas Citharel2017-05-281-1/+0
| | | | Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* Move Tags assigner to a separate fileThomas Citharel2017-05-271-53/+3
| | | | Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* Added headers field in EntryNicolas Lœuillet2017-05-111-0/+4
|
* Added author of articleNicolas Lœuillet2017-04-091-1/+5
|
* Added publication dateNicolas Lœuillet2017-04-051-0/+4
|
* Avoid false preview imageJeremy Benoist2017-01-101-1/+1
| | | | | If the website doesn't provide an og_image, the value will be false and so it'll be saved like that in the database. We prefer to leave it as null instead of false.
* Add some commentsJeremy Benoist2016-12-041-0/+3
|