htaccess + token bugfix

This commit is contained in:
Roman committed 2021-01-14 23:41:16 +01:00
1 parent e909e7b221
commit 518045e238
4 files changed
+10 -3

No files matched your search

+4
View File
@@ -6,6 +6,10 @@ DirectorySlash Off
RewriteEngine On
RewriteRule ^api(/.*)?$ /index.php?api=$1 [L,QSA]
RewriteEngine On
RewriteOptions AllowNoSlash
RewriteRule ^files$ /files/ [L,QSA]
RewriteEngine On
RewriteOptions AllowNoSlash
RewriteRule ^((\.idea|\.git|src|test|core)(/.*)?)$ /index.php?site=$1 [L,QSA]
-2
View File
@@ -8,8 +8,6 @@ export default class API {
}
csrfToken() {
console.log(this.loggedIn);
console.log(this.user);
return this.loggedIn ? this.user.session.csrf_token : null;
}
+5
View File
@@ -118,6 +118,7 @@ class FileControlPanel extends React.Component {
}
newState.files = res.files;
} else {
newState.token.value = (newState.token.value ? "" : token);
newState.errorMessage = res.msg;
}
@@ -137,6 +138,10 @@ class FileControlPanel extends React.Component {
let checkUser = true;
let pathName = window.location.pathname;
if (pathName.startsWith("/files")) {
pathName = pathName.substr("/files".length);
}
if (pathName.length > 1) {
let end = (pathName.endsWith("/") ? pathName.length - 2 : pathName.length - 1);
let start = (pathName.startsWith("/files/") ? ("/files/").length : 1);
+1 -1
View File
@@ -299,4 +299,4 @@ e.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var r,a,i,o,s;if("undefined"==typeof window||"function"!=typeof MessageChannel){var u=null,l=null,d=function(){if(null!==u)try{var e=t.unstable_now();u(!0,e),u=null}catch(e){throw setTimeout(d,0),e}},c=Date.now();t.unstable_now=function(){return Date.now()-c},r=function(e){null!==u?setTimeout(r,0,e):(u=e,setTimeout(d,0))},a=function(e,t){l=setTimeout(e,t)},i=function(){clearTimeout(l)},o=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var f=window.performance,_=window.Date,m=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){var p=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof p&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof f&&"function"==typeof f.now)t.unstable_now=function(){return f.now()};else{var y=_.now();t.unstable_now=function(){return _.now()-y}}var M=!1,v=null,g=-1,L=5,k=0;o=function(){return t.unstable_now()>=k},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):L=0<e?Math.floor(1e3/e):5};var b=new MessageChannel,Y=b.port2;b.port1.onmessage=function(){if(null!==v){var e=t.unstable_now();k=e+L;try{v(!0,e)?Y.postMessage(null):(M=!1,v=null)}catch(e){throw Y.postMessage(null),e}}else M=!1},r=function(e){v=e,M||(M=!0,Y.postMessage(null))},a=function(e,n){g=m((function(){e(t.unstable_now())}),n)},i=function(){h(g),g=-1}}function w(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,a=e[r];if(!(void 0!==a&&0<S(a,t)))break e;e[r]=t,e[n]=a,n=r}}function D(e){return void 0===(e=e[0])?null:e}function T(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length;r<a;){var i=2*(r+1)-1,o=e[i],s=i+1,u=e[s];if(void 0!==o&&0>S(o,n))void 0!==u&&0>S(u,o)?(e[r]=u,e[s]=n,r=s):(e[r]=o,e[i]=n,r=i);else{if(!(void 0!==u&&0>S(u,n)))break e;e[r]=u,e[s]=n,r=s}}}return t}return null}function S(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var x=[],j=[],E=1,H=null,O=3,P=!1,F=!1,A=!1;function N(e){for(var t=D(j);null!==t;){if(null===t.callback)T(j);else{if(!(t.startTime<=e))break;T(j),t.sortIndex=t.expirationTime,w(x,t)}t=D(j)}}function C(e){if(A=!1,N(e),!F)if(null!==D(x))F=!0,r(W);else{var t=D(j);null!==t&&a(C,t.startTime-e)}}function W(e,n){F=!1,A&&(A=!1,i()),P=!0;var r=O;try{for(N(n),H=D(x);null!==H&&(!(H.expirationTime>n)||e&&!o());){var s=H.callback;if(null!==s){H.callback=null,O=H.priorityLevel;var u=s(H.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?H.callback=u:H===D(x)&&T(x),N(n)}else T(x);H=D(x)}if(null!==H)var l=!0;else{var d=D(j);null!==d&&a(C,d.startTime-n),l=!1}return l}finally{H=null,O=r,P=!1}}function z(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var R=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){F||P||(F=!0,r(W))},t.unstable_getCurrentPriorityLevel=function(){return O},t.unstable_getFirstCallbackNode=function(){return D(x)},t.unstable_next=function(e){switch(O){case 1:case 2:case 3:var t=3;break;default:t=O}var n=O;O=t;try{return e()}finally{O=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=R,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=O;O=e;try{return t()}finally{O=n}},t.unstable_scheduleCallback=function(e,n,o){var s=t.unstable_now();if("object"==typeof o&&null!==o){var u=o.delay;u="number"==typeof u&&0<u?s+u:s,o="number"==typeof o.timeout?o.timeout:z(e)}else o=z(e),u=s;return e={id:E++,callback:n,priorityLevel:e,startTime:u,expirationTime:o=u+o,sortIndex:-1},u>s?(e.sortIndex=u,w(j,e),null===D(x)&&e===D(j)&&(A?i():A=!0,a(C,u-s))):(e.sortIndex=o,w(x,e),F||P||(F=!0,r(W))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();N(e);var n=D(x);return n!==H&&null!==H&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<H.expirationTime||o()},t.unstable_wrapCallback=function(e){var t=O;return function(){var n=O;O=t;try{return e.apply(this,arguments)}finally{O=n}}}},function(e,t,n){"use strict";(function(e){if(n(276),n(473),n(474),e._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");e._babelPolyfill=!0;function t(e,t,n){e[t]||Object.defineProperty(e,t,{writable:!0,configurable:!0,value:n})}t(String.prototype,"padLeft","".padStart),t(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter, Line truncated
*/var r,a,i,o,s;if("undefined"==typeof window||"function"!=typeof MessageChannel){var u=null,l=null,d=function(){if(null!==u)try{var e=t.unstable_now();u(!0,e),u=null}catch(e){throw setTimeout(d,0),e}},c=Date.now();t.unstable_now=function(){return Date.now()-c},r=function(e){null!==u?setTimeout(r,0,e):(u=e,setTimeout(d,0))},a=function(e,t){l=setTimeout(e,t)},i=function(){clearTimeout(l)},o=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var f=window.performance,_=window.Date,m=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){var p=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof p&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof f&&"function"==typeof f.now)t.unstable_now=function(){return f.now()};else{var y=_.now();t.unstable_now=function(){return _.now()-y}}var M=!1,v=null,g=-1,L=5,k=0;o=function(){return t.unstable_now()>=k},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):L=0<e?Math.floor(1e3/e):5};var b=new MessageChannel,Y=b.port2;b.port1.onmessage=function(){if(null!==v){var e=t.unstable_now();k=e+L;try{v(!0,e)?Y.postMessage(null):(M=!1,v=null)}catch(e){throw Y.postMessage(null),e}}else M=!1},r=function(e){v=e,M||(M=!0,Y.postMessage(null))},a=function(e,n){g=m((function(){e(t.unstable_now())}),n)},i=function(){h(g),g=-1}}function w(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,a=e[r];if(!(void 0!==a&&0<S(a,t)))break e;e[r]=t,e[n]=a,n=r}}function D(e){return void 0===(e=e[0])?null:e}function T(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,a=e.length;r<a;){var i=2*(r+1)-1,o=e[i],s=i+1,u=e[s];if(void 0!==o&&0>S(o,n))void 0!==u&&0>S(u,o)?(e[r]=u,e[s]=n,r=s):(e[r]=o,e[i]=n,r=i);else{if(!(void 0!==u&&0>S(u,n)))break e;e[r]=u,e[s]=n,r=s}}}return t}return null}function S(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var x=[],j=[],E=1,H=null,O=3,P=!1,F=!1,A=!1;function N(e){for(var t=D(j);null!==t;){if(null===t.callback)T(j);else{if(!(t.startTime<=e))break;T(j),t.sortIndex=t.expirationTime,w(x,t)}t=D(j)}}function C(e){if(A=!1,N(e),!F)if(null!==D(x))F=!0,r(W);else{var t=D(j);null!==t&&a(C,t.startTime-e)}}function W(e,n){F=!1,A&&(A=!1,i()),P=!0;var r=O;try{for(N(n),H=D(x);null!==H&&(!(H.expirationTime>n)||e&&!o());){var s=H.callback;if(null!==s){H.callback=null,O=H.priorityLevel;var u=s(H.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?H.callback=u:H===D(x)&&T(x),N(n)}else T(x);H=D(x)}if(null!==H)var l=!0;else{var d=D(j);null!==d&&a(C,d.startTime-n),l=!1}return l}finally{H=null,O=r,P=!1}}function z(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var R=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){F||P||(F=!0,r(W))},t.unstable_getCurrentPriorityLevel=function(){return O},t.unstable_getFirstCallbackNode=function(){return D(x)},t.unstable_next=function(e){switch(O){case 1:case 2:case 3:var t=3;break;default:t=O}var n=O;O=t;try{return e()}finally{O=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=R,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=O;O=e;try{return t()}finally{O=n}},t.unstable_scheduleCallback=function(e,n,o){var s=t.unstable_now();if("object"==typeof o&&null!==o){var u=o.delay;u="number"==typeof u&&0<u?s+u:s,o="number"==typeof o.timeout?o.timeout:z(e)}else o=z(e),u=s;return e={id:E++,callback:n,priorityLevel:e,startTime:u,expirationTime:o=u+o,sortIndex:-1},u>s?(e.sortIndex=u,w(j,e),null===D(x)&&e===D(j)&&(A?i():A=!0,a(C,u-s))):(e.sortIndex=o,w(x,e),F||P||(F=!0,r(W))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();N(e);var n=D(x);return n!==H&&null!==H&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<H.expirationTime||o()},t.unstable_wrapCallback=function(e){var t=O;return function(){var n=O;O=t;try{return e.apply(this,arguments)}finally{O=n}}}},function(e,t,n){"use strict";(function(e){if(n(276),n(473),n(474),e._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");e._babelPolyfill=!0;function t(e,t,n){e[t]||Object.defineProperty(e,t,{writable:!0,configurable:!0,value:n})}t(String.prototype,"padLeft","".padStart),t(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter, Line truncated