This replaces the abandoned fork with my own fork at splitbrain/lesserphp
That fork has been cleaned up somewhat and the issues in #4088 should be
fixed.
Error codes are now extracted from API core and printed on the OpenAPI
overview page. This makes it easier to see what is in use.
Error messages have been cleaned up, some new codes have been assigned.
Some errors have been removed. Eg. it is fine to iterate a media
namespace you don't have read access to. The result will either be empty
or contain files from lower namespaces that you *do* have access to.
Failed because positional parameters are not really possible to model.
Named parameter could be introduces when our minimum requirement is
switched to PHP8+
This implements the slightly more standardized JSON-RPC standard as an
alternative to my home-grown version. The same server handled all formats
including my own simpler variant.
XMLRPC is a rather outdated and old-fashioned protocol not much in use
anymore. Developers prefer simpler, JSON based APIs.
This adds a new "JSONRPC" API. Basically it exposes exactly the same
method calls as the XMLRPC API but using JSON instead of XML. It's not a
classical REST API, but should be just as easy to use for developers.
Here is an example call using CURL:
curl http://localhost/dokuwiki/lib/exe/jsonrpc.phs \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $token" \
-d '["wiki"]'
Please note that the above uses the token auth implemented in #2432.
Authentication via basic auth or cookies would work as well.
* pr/3908:
JPEGMeta: clean up exception handling
Fix: Do not garbage collect the JpegMeta object after reading a tag
Replace check for null with cast to string
Fix: Rework error handling in JpegMeta marker reading
Replace is_null() check with count()
Fix: Padding in _getFixedString, log the path of damaged images
Fix: PHP8-related JpegMeta.php fixes
Backwards Compatibility: Don't error if finishSectionEdit is called without first startSectionEdit
Fix: 'E_WARNING: Uninitialized string offset -1' on some templates
Fix: 'E_WARNING: Undefined array key "_data"'
The refshow option has been removed in
3e7e027794 and should not have been
checked anymore. This fixes a warning on PHP8 when deleting a media
file.
Replaces #3912
This drops the sandbox attribute as discussed in #3710 to re-enable
inline display of PDFs in Safari again.
Dropping the sandbox attribute should also help with using navigational
links within SVG files as discussed in
https://forum.dokuwiki.org/d/20420-how-to-embed-svg-with-links-the-proper-way
It also allows the loading of fonts from within SVG files. This
currently does not allow font loading from google fonts as asked for
in #3709 though. I'm not sure if we should favor any font provider here.
* never try to use slika to resize SVGs - let the browser do it
* use object-fit:cover for all images - this properly crops inside the
browser if the backend didn't (like for SVGs). currently dokuwiki
template only - might be worth moving to default styles
* show previews for SVGs in media manager
This continues the quest to make more use of SVG in the DokuWiki
iconography. Interwiki links are now preferred in SVG, the existing
icons have been replaces by SVGs. This also adjusts the default icons
for external, mail and UNC links.
Icons come from https://materialdesignicons.com/ and
https://github.com/edent/SuperTinyIcons
I kept the old default icons because they might be used by plugins and
templates. They might be deleted later
The DokuWiki interwiki icon huge in filesize compared to all others and
doesn't look good. Would be good to have a simplified version there.
* master:
dwpage: output meta data as JSON
dwpage: rename gmeta into getmeta
translation update
Make it easier to remove h1 around logo
fix: better max-width for images in tables
dwpage.php: add an option to get metadata
rename namespace Media to File
use SVG icons for media file links
readded $jump mechanism, removed unused functions
fix use of $rev parameter
fix entity definition
reenable the option to display a relative namespace for media files
simplified the media_searchlist tests
make use of the new media file classes
SVG based file icons
first go a refactoring the media manager
lazy load images
This error only occurs when PHPUnit runs both the `testScripts` and the
`test_Validity` suites [1], because all tests are running in the same
PHP process.
Adding an `if(!defined` check to avoid the problem.
[1]: ./phpunit.phar --filter 'testScripts|test_Validity'
This adds a CSP header for all media delivered through our fetch.php
dispatcher. This should revent any scripts etc. to be executed when
scriptable media, like SVG is used.
Suggestions on finetuning the policy are welcome.
The policy is added to the MEDIA_SENDFILE event, so plugins can easily
influence it. The way it is passed as an array should make it easier to
modify from plugins as well.
I put the mechanism to send the header into it's own class in the HTTP
namespace. Additional methods from inc/httputils could be moved here
later. The method might also be interesting for #2198 and #1676.