Improved og implementation

Bugfixes
This commit is contained in:
Sergio Brighenti 2021-03-07 17:21:07 +01:00
parent 7cd172510c
commit 014b5428aa
14 changed files with 1086 additions and 344 deletions

View file

@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [3.3.4] - 2021-03-07
### Fixed
- Fixed open graph meta tags for Discord.
- Fixed custom html tags are not displayed back in the admin setting.
- Fixed python plugin for newer version of Screencloud.
- Fixed accented chars in email subject.
## [3.3.3] - 2020-11-13
### Fixed
- Fixed issue with responsive menu on mobile.

View file

@ -142,6 +142,7 @@ module.exports = function (grunt) {
'resources/templates/**/*',
'resources/schemas/**/*',
'resources/lang/**/*',
'resources/uploaders/**/*',
'static/**/*',
'vendor/**/*',
'.htaccess',

View file

@ -98,7 +98,7 @@ class LoginController extends AuthController
$this->session->alert(lang('goodbye'), 'warning');
if (!empty($request->getCookieParams()['remember'])) {
setcookie('remember', null);
setcookie('remember', null, 0, '', '', false, true);
}
return redirect($response, route('login.show'));

View file

@ -71,7 +71,7 @@ class Mail
*/
public function subject(string $text)
{
$this->subject = htmlentities($text);
$this->subject = $text;
return $this;
}
@ -81,7 +81,7 @@ class Mail
*/
public function message(string $text)
{
$this->message = htmlentities($text);
$this->message = $text;
return $this;
}

View file

@ -325,8 +325,6 @@ if (!function_exists('isBot')) {
$bots = [
'TelegramBot',
'facebookexternalhit/',
'Discordbot/',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Firefox/38.0', // The discord service bot?
'Facebot',
'curl/',
'wget/',

View file

@ -1,7 +1,7 @@
{
"name": "sergix44/xbackbone",
"license": "AGPL-3.0-only",
"version": "3.3.3",
"version": "3.3.4",
"description": "A lightweight ShareX PHP backend",
"type": "project",
"require": {

1326
composer.lock generated

File diff suppressed because it is too large Load diff

46
package-lock.json generated
View file

@ -3,9 +3,9 @@
"lockfileVersion": 1,
"dependencies": {
"@fortawesome/fontawesome-free": {
"version": "5.15.1",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.1.tgz",
"integrity": "sha512-OEdH7SyC1suTdhBGW91/zBfR6qaIhThbcN8PUXtXilY4GYnSBbVqOntdHbC1vXwsDnX0Qix2m2+DSU1J51ybOQ=="
"version": "5.15.2",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.2.tgz",
"integrity": "sha512-7l/AX41m609L/EXI9EKH3Vs3v0iA8tKlIOGtw+kgcoanI7p+e4I4GYLqW3UXWiTnjSFymKSmTTPKYrivzbxxqA=="
},
"abbrev": {
"version": "1.1.1",
@ -200,9 +200,9 @@
}
},
"bootstrap": {
"version": "4.5.3",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.5.3.tgz",
"integrity": "sha512-o9ppKQioXGqhw8Z7mah6KdTYpNQY//tipnkxppWhPbiSWdD+1raYsnhwEZjkTHYbGee4cVQ0Rx65EhOY/HNLcQ=="
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.6.0.tgz",
"integrity": "sha512-Io55IuQY3kydzHtbGvQya3H+KorS/M9rSNyfCGCg9WZ4pyT/lCxIlpJgG1GXW/PswzC84Tr2fBYi+7+jFVQQBw=="
},
"bootstrap4-toggle": {
"version": "3.6.1",
@ -341,9 +341,9 @@
}
},
"clipboard": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.6.tgz",
"integrity": "sha512-g5zbiixBRk/wyKakSwCKd7vQXDjFnAMGHoEyBogG/bw9kTD9GvdAvaoRR1ALcEzt3pVKxZR0pViekPMIS0QyGg==",
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.7.tgz",
"integrity": "sha512-8M8WEZcIvs0hgOma+wAPkrUxpv0PMY1L6VsAJh/2DOKARIMpyWe6ZLcEoe1qktl6/ced5ceYHs+oGedSbgZ3sg==",
"requires": {
"good-listener": "^1.2.2",
"select": "^1.1.2",
@ -415,9 +415,9 @@
"dev": true
},
"core-js": {
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.7.0.tgz",
"integrity": "sha512-NwS7fI5M5B85EwpWuIwJN4i/fbisQUwLwiSNUWeXlkAZ0sbBjLEvLvFLf1uzAUV66PcEPt4xCGCmOZSxVf3xzA=="
"version": "3.9.1",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.9.1.tgz",
"integrity": "sha512-gSjRvzkxQc1zjM/5paAmL4idJBFzuJoo+jDjF1tStYFMV2ERfD02HhahhCGXUyHxQRG4yFKVSdO6g62eoRMcDg=="
},
"core-util-is": {
"version": "1.0.2",
@ -559,9 +559,9 @@
}
},
"dropzone": {
"version": "5.7.2",
"resolved": "https://registry.npmjs.org/dropzone/-/dropzone-5.7.2.tgz",
"integrity": "sha512-m217bJHtf0J1IiKn4Tv6mnu1h5QvQNBnKZ39gma7hzGQhIZMxYq1vYEHs4AVd4ThFwmALys+52NAOD4zdLTG4w=="
"version": "5.8.0",
"resolved": "https://registry.npmjs.org/dropzone/-/dropzone-5.8.0.tgz",
"integrity": "sha512-aJQ0VpHrhkm7TcAaeUgCgnyGP/7gNXjNBM6xxx+7HPlLiHfFUa2PkfRMU3wHgBNPyH+UcF/zpJWY3QCt4l61xQ=="
},
"duplexer": {
"version": "0.1.1",
@ -1629,9 +1629,9 @@
"dev": true
},
"jquery": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz",
"integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg=="
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz",
"integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw=="
},
"js-yaml": {
"version": "3.14.0",
@ -2131,15 +2131,15 @@
}
},
"plyr": {
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/plyr/-/plyr-3.6.2.tgz",
"integrity": "sha512-CjAhRDtzyGqMRte9Phj4FsZFegS9VxW60boOhQsAnZHuiFG3yVBRcodWsGZ79GuXHHelc4DxMHO+z0QggY+9qQ==",
"version": "3.6.4",
"resolved": "https://registry.npmjs.org/plyr/-/plyr-3.6.4.tgz",
"integrity": "sha512-l0EKsRxhwGtzpPJhs+okusogXRiJaagNaGYlj+iiyqyNzjh0ef5bhxNLsKhpsGvvZMnfV/KbOvIva+qeNCA9ng==",
"requires": {
"core-js": "^3.6.5",
"core-js": "^3.8.1",
"custom-event-polyfill": "^1.0.7",
"loadjs": "^4.2.0",
"rangetouch": "^2.0.1",
"url-polyfill": "^1.1.8"
"url-polyfill": "^1.1.12"
}
},
"popper.js": {

View file

@ -1,14 +1,14 @@
{
"dependencies": {
"@fortawesome/fontawesome-free": "^5.15.1",
"bootstrap": "^4.5.3",
"@fortawesome/fontawesome-free": "^5.15.2",
"bootstrap": "^4.6.0",
"bootstrap4-toggle": "^3.6.1",
"clipboard": "^2.0.6",
"dropzone": "^5.7.2",
"clipboard": "^2.0.7",
"dropzone": "^5.8.0",
"highlightjs": "^9.16.2",
"highlightjs-line-numbers.js": "^2.8.0",
"jquery": "^3.5.1",
"plyr": "^3.6.2",
"jquery": "^3.6.0",
"plyr": "^3.6.4",
"popper.js": "^1.16.1",
"tooltip.js": "^1.3.3"
},

View file

@ -27,6 +27,13 @@
<link href="{{ asset('/static/dropzone/dropzone.min.css') }}" rel="stylesheet">
<link href="{{ asset('/static/bootstrap/css/bootstrap4-toggle.min.css') }}" rel="stylesheet">
<link href="{{ asset('/static/app/app.css') }}" rel="stylesheet">
{% block meta %}
<meta id="embed-title" property="og:title" content="{{ block('title') }}">
<meta id="discord" name="twitter:image" content="{{ asset('/static/images/favicon-32x32.png') }}">
<meta id="image-src" name="twitter:image:src" content="{{ asset('/static/images/favicon-32x32.png') }}">
<meta id="embed-image" property="og:image" content="{{ asset('/static/images/favicon-32x32.png') }}">
<meta id="embed-desc" property="og:description" content="Proudly powered by XBackBone">
{% endblock %}
<script>
window.AppConfig = {
'base_url': '{{ urlFor() }}',

View file

@ -94,7 +94,7 @@
<div class="form-group row">
<label for="custom_head" class="col-sm-4 col-form-label">{{ lang('custom_head_html') }}</label>
<div class="col-sm-8">
<textarea name="custom_head" class="form-control text-monospace">{{ settings.customHead|raw }}</textarea>
<textarea name="custom_head" class="form-control text-monospace">{{ settings.custom_head|raw }}</textarea>
<small>{{ lang('custom_head_html_hint') }}</small>
</div>
</div>

View file

@ -5,7 +5,20 @@
{% block head %}
{% if type == 'image' %}
<link rel="preload" href="{{ url }}/raw" as="{{ type }}">
<meta name="og:image" itemprop="{{ type }}" content="{{ url }}/raw">
{% endif %}
{% endblock %}
{% block meta %}
<meta name="twitter:card" content="summary_large_image">
<meta property="og:type" content="website"/>
<meta id="embed-title" property="og:title" content="{{ media.filename }} ({{ media.size }})">
<meta id="embed-desc" property="og:description" content="{{ lang('date') }}: {{ media.timestamp }}">
{% if type == 'image' %}
<meta id="embed-image" property="og:image" content="{{ url }}/raw">
<meta id="discord" name="twitter:image" content="{{ url }}/raw">
<meta id="image-src" name="twitter:image:src" content="{{ url }}/raw">
<meta id="discord" name="twitter:image" content="{{ url }}/raw">
<meta id="image-src" name="twitter:image:src" content="{{ url }}/raw">
{% endif %}
{% endblock %}

View file

@ -79,7 +79,7 @@ class XBackBoneUploader:
try:
res = urllib.request.urlopen(r)
response = json.loads(res.read())
response = json.loads(res.read().decode('utf-8'))
url = response.get('url')
if not url:

View file

@ -3,5 +3,5 @@
<shortname>xbackbone</shortname>
<className>XBackBoneUploader</className>
<icon>icon.png</icon>
<version>1.0</version>
<version>1.1</version>
</metadata>