Giter Site home page Giter Site logo

mprins / dokuwiki-plugin-socialcards Goto Github PK

View Code? Open in Web Editor NEW
5.0 4.0 2.0 78 KB

Adds twitter and other card info to your wiki pages.

Home Page: https://www.dokuwiki.org/plugin:socialcards

License: ISC License

PHP 100.00%
dokuwiki socialcards-plugin twitter opengraph facebook meta seo hacktoberfest

dokuwiki-plugin-socialcards's Introduction

Hi there ๐Ÿ‘‹

I'm Mark Prins, welcome to my github profile. I'm a spatial/GIS developer working mostly with Java, XSL, Typescript, Python, SQL and PHP. You may know me from work on DokuWiki plugins, GeoTools and GeoServer, OSHI, historic work on Geozet or one of the many @B3Partners products of my current employer.

:octocat: All the statistics

MPrins's GitHub stats

Twitter Follow GitHub Sponsors GitHub User's stars GitHub followers

dokuwiki-plugin-socialcards's People

Contributors

alexbelchior avatar alexgearbox avatar araname avatar dependabot[bot] avatar dokuwiki-translate avatar github-actions[bot] avatar jensz12 avatar mprins avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dokuwiki-plugin-socialcards's Issues

Plugin leaks data from ACL-protected pages

I just came across the fact that the plugin does not honor ACLs as it seems. It's what #28 was all about as well, I think.

Hope you can implement this a little differently, so information does not get leaked from protected pages this way. That would be awesome :-)

environment

  • php version: 7.4
  • dokuwiki version: Release 2020-07-29 "Hogfather"
  • plugin version / date: 2022-04-12
  • list of any other plugins (apart from bundled plugins):

expected behaviour

When a page is set to not be accessible for the general public and the link to it is posted to - say - Discord, the card info should be something like "permission denied".

actual behaviour

When a page is set to not be accessible for the general public and the link to it is posted to - say - Discord, the card info shows the actual content of the page aka it leaks the protected information.

steps to reproduce actual behaviour

Install the plugin, only allow access to a page by the admin (and nobody else) and then post the link to Discord or Twitter or anywhere where a preview would be shown. You'll see the page content, which you tried to hide by disallowing the general public from viewing the page. You could look at the HTML source as well, of course.

p_get_metadata(... ) API update

p_get_metadata($ID, 'title', true), doe not have that signature, the 3rd parameter should be:

/** Don't render metadata even if it is outdated or doesn't exist */
25 define('METADATA_DONT_RENDER', 0);

/**
27 * Render metadata when the page is really newer or the metadata doesn't exist.
28 * Uses just a simple check, but should work pretty well for loading simple
29 * metadata values like the page title and avoids rendering a lot of pages in
30 * one request. The P_GET_METADATA_RENDER_LIMIT is used in this mode.
31 * Use this if it is unlikely that the metadata value you are requesting
32 * does depend e.g. on pages that are included in the current page using
33 * the include plugin (this is very likely the case for the page title, but
34 * not for relation references).
35 */
36 define('METADATA_RENDER_USING_SIMPLE_CACHE', 1);

or

37 /**
38 * Render metadata using the metadata cache logic. The P_GET_METADATA_RENDER_LIMIT
39 * is used in this mode. Use this mode when you are requesting more complex
40 * metadata. Although this will cause rendering more often it might actually have
41 * the effect that less current metadata is returned as it is more likely than in
42 * the simple cache mode that metadata needs to be rendered for all pages at once
43 * which means that when the metadata for the page is requested that actually needs
44 * to be updated the limit might have been reached already.
45 */
46 define('METADATA_RENDER_USING_CACHE', 2);

in our case we're using true which most php will translate to 1 (METADATA_RENDER_USING_SIMPLE_CACHE )

allow media id for fallback image

currently the fallback image needs to be a fully qualified url to an image (eg. http://www.hooidonksekanoclub.nl/dokuwiki/_media/logo-hkc.jpg), it would be good to be able to use a media id, eg: wiki:dokuwiki-128.png

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.