-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update CdactionBridge #4725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Update CdactionBridge #4725
Conversation
Pull request artifacts
last change: Saturday 2025-09-13 13:12:30 |
| $newsJson = $html->find('script#__NEXT_DATA__', 0)->innertext; | ||
| if (!$newsJson = json_decode($newsJson)) { | ||
| if ($this->getInput('category') === 'feed') { | ||
| $xml = simplexml_load_file($feedUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to drop usage of this function? because it has security implications
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, you mean simplexml_load_file? I need to load https://cdaction.pl/feed/ it's XML with all needed data.
I can add some tweaks, like flags LIBXML_NONET | LIBXML_NOERROR | LIBXML_NOWARNING and validate if file is really a xml. Any other suggesions?
Mynacol
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from the Najnowsze (wszystkie) category (which only gets the website-provided feed and uses the already remarked simplexml_load_file function, this bridge throws (at least now) only errors:
Details
Type: ErrorException
Code: 0
Message: Attempt to read property "plaintext" on null
File: bridges/CdactionBridge.php
Line: 53
Trace
#0 index.php(73): RssBridge->main()
#1 lib/RssBridge.php(39): RssBridge->{closure:RssBridge::main():37}()
#2 lib/RssBridge.php(37): BasicAuthMiddleware->__invoke()
#3 middlewares/BasicAuthMiddleware.php(13): RssBridge->{closure:RssBridge::main():37}()
#4 lib/RssBridge.php(37): CacheMiddleware->__invoke()
#5 middlewares/CacheMiddleware.php(44): RssBridge->{closure:RssBridge::main():37}()
#6 lib/RssBridge.php(37): ExceptionMiddleware->__invoke()
#7 middlewares/ExceptionMiddleware.php(17): RssBridge->{closure:RssBridge::main():37}()
#8 lib/RssBridge.php(37): SecurityMiddleware->__invoke()
#9 middlewares/SecurityMiddleware.php(19): RssBridge->{closure:RssBridge::main():37}()
#10 lib/RssBridge.php(37): MaintenanceMiddleware->__invoke()
#11 middlewares/MaintenanceMiddleware.php(10): RssBridge->{closure:RssBridge::main():37}()
#12 lib/RssBridge.php(37): TokenAuthenticationMiddleware->__invoke()
#13 middlewares/TokenAuthenticationMiddleware.php(10): RssBridge->{closure:RssBridge::main():33}()
#14 lib/RssBridge.php(34): DisplayAction->__invoke()
#15 actions/DisplayAction.php(54): DisplayAction->createResponse()
#16 actions/DisplayAction.php(89): CdactionBridge->collectData()
#17 bridges/CdactionBridge.php(53): {closure:/home/paul/projects/rss-bridge/index.php:26}()
#18 bridges/CdactionBridge.php(53)
Page was changed.