-
Notifications
You must be signed in to change notification settings - Fork 2
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
Issue #56: Refactor CoolRequest #68
Conversation
9c78e89
to
bd16013
Compare
a88a469
to
6b73cbb
Compare
src/Cool/CollaboraConnection.php
Outdated
"The configured Collabora Online server address must begin with 'http://' or 'https://'. Found '%s'.", | ||
$wopi_client_server, | ||
)); | ||
} |
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.
All this validation of config values seems a bit out of place.
In most of Drupal core, config values are simply trusted - for better or worse.
But, currently the config form itself does not really validate these settings.
We do have a schema, but in the config form I can just enter any value I like for the server and host url, e.g. "abc".
Imo we should keep the validation as-is for now, and only change it once we have proper validation in the form.
(The validation is coming from the original code, it has been moved around and refactored but it is still mostly equivalent with the original code.)
Original steps: - Rename vars in strStartsWith(). - Simplify strStartsWith(). - Fix strStartsWith() by using strpos() instead of strrpos(). - Replace strStartsWith() with str_starts_with().
It can happen that file_get_contents() hangs at the end of a stream, waiting for more data. With curl it seems this does not happen. Even better would be to use e.g. Guzzle http client, but that's too big a change for now.
Changes: - Narrow parameter type for $discovery_parsed, don't check for NULL or FALSE anymore. - Use (string) cast instead of strval(). - Harden the condition for return value from xpath. - Let getWopiSrcUrl() always return string or throw exception. - Inline the function. - Invert if statement, to align with the rest.
6b73cbb
to
840ead8
Compare
840ead8
to
c40af62
Compare
…t in ViewerController. Also make the private property protected.
…e value to getViewerRender().
143cce9
to
7ebfa5c
Compare
7ebfa5c
to
e663b8d
Compare
Further changes will be done in a follow-up issue.