aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-02-13 15:06:28 +0100
committerGravatar GitHub <noreply@github.com> 2019-02-13 15:06:28 +0100
commit2374374ba972eb4cca84d7f71b1900f806c2b914 (patch)
tree71496d87cf87d14650da48154f7d232418404c21 /lib
parent142c80a4b8e13ce93f6c2eb697afeb7e6b54431e (diff)
Less jQuery (#2234)
* Less jQuery Follow-up of https://github.com/FreshRSS/FreshRSS/pull/2199 * Even less jQuery + global view unread title fix * Even less jQuery * Yet even less jQuery * Even less jQuery * Reduce some events * Even less jQuery * jQuery gone from main view +Fixed English i18n * Fix feed folded view * Remove Firefox 64 workaround Remove workaround for Gecko bug 1514498 in Firefox 64, fixed in Firefox 65 * Split to extra.js Avoid loading unneeded JavaScript code for the main view. + several adjustements * Improve CSS transition fold category * Rewrite shortcuts Remove library. Much faster, shorter, one listener instead of many. Control of the shortcut context. Fix https://github.com/FreshRSS/FreshRSS/issues/2215 * Remove debug * Minor syntax * Filter out unwanted shortcut modifiers * Menu overflow fix * Typo * Fix unfolding in mobile view * Remove jQuery from category.js * Remove jQuery from Global view
Diffstat (limited to 'lib')
-rw-r--r--lib/Minz/Request.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php
index 8b2b610d6..912c354ac 100644
--- a/lib/Minz/Request.php
+++ b/lib/Minz/Request.php
@@ -95,6 +95,7 @@ class Minz_Request {
*/
public static function init() {
self::magicQuotesOff();
+ self::initJSON();
}
/**
@@ -238,6 +239,30 @@ class Minz_Request {
}
/**
+ * Allows receiving POST data as application/json
+ */
+ private static function initJSON() {
+ $contentType = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : '';
+ if ($contentType == '') { //PHP < 5.3.16
+ $contentType = isset($_SERVER['HTTP_CONTENT_TYPE']) ? $_SERVER['HTTP_CONTENT_TYPE'] : '';
+ }
+ $contentType = strtolower(trim($contentType));
+ if ($contentType === 'application/json') {
+ $ORIGINAL_INPUT = file_get_contents('php://input', false, null, 0, 1048576);
+ if ($ORIGINAL_INPUT != '') {
+ $json = json_decode($ORIGINAL_INPUT, true);
+ if ($json != null) {
+ foreach ($json as $k => $v) {
+ if (!isset($_POST[$k])) {
+ $_POST[$k] = $v;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
* Permet de récupérer une variable de type $_POST
* @param $param nom de la variable
* @param $default valeur par défaut à attribuer à la variable