1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-06-18 02:44:55 +00:00

Trim the image url before short url detection. Fixes #108.

This commit is contained in:
Starbeamrainbowlabs 2016-10-11 19:26:42 +01:00
parent f267c9d5a0
commit 53f4f2227d
4 changed files with 4 additions and 3 deletions

View file

@ -15,6 +15,7 @@
- The login session lifetime is now configurable (defaults to 24 hours), so you won't keep getting logged out all the time (in theory). (#113)
- Recent changes made on different days are now displayed separately, as they should be (#112)
- Always display footer message at the bottom of the page.
- Trim the image url before short image url detection (#108)
- Fxed huge issue with `contentonly` display mode.
## v0.12.1

View file

@ -5345,7 +5345,7 @@ class PeppermintParsedown extends ParsedownExtra
* 5 - Third param (optional)
*/
$altText = $matches[1];
$imageUrl = str_replace("&", "&", $matches[2]); // Decode & to allow it in preview urls
$imageUrl = trim(str_replace("&", "&", $matches[2])); // Decode & to allow it in preview urls
$param1 = empty($matches[3]) ? false : strtolower(trim($matches[3]));
$param2 = empty($matches[4]) ? false : strtolower(trim($matches[4]));
$param3 = empty($matches[5]) ? false : strtolower(trim($matches[5]));

View file

@ -203,7 +203,7 @@
"author": "Emanuil Rusev & Starbeamrainbowlabs",
"description": "An upgraded (now default!) parser based on Emanuil Rusev's Parsedown Extra PHP library (https:\/\/github.com\/erusev\/parsedown-extra), which is licensed MIT. Please be careful, as this module adds some weight to your installation, and also *requires* write access to the disk on first load.",
"id": "parser-parsedown",
"lastupdate": 1476813024,
"lastupdate": 1476814064,
"optional": false
}
]

View file

@ -405,7 +405,7 @@ class PeppermintParsedown extends ParsedownExtra
* 5 - Third param (optional)
*/
$altText = $matches[1];
$imageUrl = str_replace("&", "&", $matches[2]); // Decode & to allow it in preview urls
$imageUrl = trim(str_replace("&", "&", $matches[2])); // Decode & to allow it in preview urls
$param1 = empty($matches[3]) ? false : strtolower(trim($matches[3]));
$param2 = empty($matches[4]) ? false : strtolower(trim($matches[4]));
$param3 = empty($matches[5]) ? false : strtolower(trim($matches[5]));