mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
remove sanitizeLocationPath
This commit is contained in:
parent
7657bad07c
commit
84a3a79bc9
3 changed files with 2 additions and 27 deletions
|
|
@ -5,7 +5,7 @@ const React = require('react');
|
|||
const { Router } = require('stremio-router');
|
||||
const { Core, Shell, Chromecast, KeyboardShortcuts, ServicesProvider } = require('stremio/services');
|
||||
const { NotFound } = require('stremio/routes');
|
||||
const { ToastProvider, sanitizeLocationPath, CONSTANTS } = require('stremio/common');
|
||||
const { ToastProvider, CONSTANTS } = require('stremio/common');
|
||||
const CoreEventsToaster = require('./CoreEventsToaster');
|
||||
const ErrorDialog = require('./ErrorDialog');
|
||||
const routerViewsConfig = require('./routerViewsConfig');
|
||||
|
|
@ -19,8 +19,7 @@ const App = () => {
|
|||
core: new Core({
|
||||
baseURI: document.baseURI,
|
||||
appVersion: process.env.VERSION,
|
||||
shellVersion: null,
|
||||
sanitizeLocationPath
|
||||
shellVersion: null
|
||||
}),
|
||||
shell: new Shell(),
|
||||
chromecast: new Chromecast(),
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ const { withCoreSuspender, useCoreSuspender } = require('./CoreSuspender');
|
|||
const getVisibleChildrenRange = require('./getVisibleChildrenRange');
|
||||
const languageNames = require('./languageNames');
|
||||
const routesRegexp = require('./routesRegexp');
|
||||
const sanitizeLocationPath = require('./sanitizeLocationPath');
|
||||
const useAnimationFrame = require('./useAnimationFrame');
|
||||
const useBinaryState = require('./useBinaryState');
|
||||
const useDeepEqualMemo = require('./useDeepEqualMemo');
|
||||
|
|
@ -73,7 +72,6 @@ module.exports = {
|
|||
getVisibleChildrenRange,
|
||||
languageNames,
|
||||
routesRegexp,
|
||||
sanitizeLocationPath,
|
||||
useAnimationFrame,
|
||||
useBinaryState,
|
||||
useDeepEqualMemo,
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
// Copyright (C) 2017-2022 Smart code 203358507
|
||||
|
||||
const UrlUtils = require('url');
|
||||
const routesRegexp = require('stremio/common/routesRegexp');
|
||||
|
||||
const sanitizeLocationPath = (path) => {
|
||||
const { href, pathname, search } = UrlUtils.parse(path);
|
||||
if (typeof pathname === 'string') {
|
||||
const matches = pathname.match(routesRegexp.player.regexp);
|
||||
if (matches) {
|
||||
if (typeof matches[2] === 'string') {
|
||||
return `/player/***/***/${matches[3]}/${matches[4]}/${matches[5]}/${matches[6]}${typeof search === 'string' ? search : ''}`;
|
||||
} else {
|
||||
return `/player/***${typeof search === 'string' ? search : ''}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return href;
|
||||
};
|
||||
|
||||
module.exports = sanitizeLocationPath;
|
||||
Loading…
Reference in a new issue