fix: code scanning alerts (#2750)
This commit is contained in:
parent
87e8ef8fe6
commit
6a64dfe4b2
|
@ -96,7 +96,7 @@ export function searchUrl(
|
|||
let route = "/search";
|
||||
|
||||
if (query) {
|
||||
route += `/${encodeURIComponent(query.replace("%", "%25"))}`;
|
||||
route += `/${encodeURIComponent(query.replace(/%/g, "%25"))}`;
|
||||
}
|
||||
|
||||
search = search ? `?${search}` : "";
|
||||
|
|
|
@ -18,7 +18,7 @@ export default function present(
|
|||
// the context contains <b> tags around search terms, we convert them here
|
||||
// to the markdown format that slack expects to receive.
|
||||
const text = context
|
||||
? context.replace(/<\/?b>/g, "*").replace("\n", "")
|
||||
? context.replace(/<\/?b>/g, "*").replace(/\n/g, "")
|
||||
: document.getSummary();
|
||||
|
||||
return {
|
||||
|
|
|
@ -5,5 +5,7 @@ const DISALLOW_ROBOTS = `User-agent: *
|
|||
Disallow: /`;
|
||||
|
||||
export const robotsResponse = (ctx: Context): ?string => {
|
||||
if (ctx.headers.host.indexOf("getoutline.com") < 0) return DISALLOW_ROBOTS;
|
||||
if (process.env.DEPLOYMENT !== "hosted") {
|
||||
return DISALLOW_ROBOTS;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -3,7 +3,7 @@ import * as React from "react";
|
|||
import Frame from "./components/Frame";
|
||||
import Image from "./components/Image";
|
||||
|
||||
const URL_REGEX = new RegExp("^https://viewer.diagrams.net/.*(title=\\w+)?");
|
||||
const URL_REGEX = /^https:\/\/viewer\.diagrams\.net\/.*(title=\\w+)?/;
|
||||
|
||||
type Props = {|
|
||||
attrs: {|
|
||||
|
|
|
@ -3,13 +3,9 @@ import * as React from "react";
|
|||
import ImageZoom from "react-medium-image-zoom";
|
||||
import Frame from "./components/Frame";
|
||||
|
||||
const IFRAME_REGEX = new RegExp(
|
||||
"^https://(invis.io/.*)|(projects.invisionapp.com/share/.*)$"
|
||||
);
|
||||
const IFRAME_REGEX = /^https:\/\/(invis\.io\/.*)|(projects\.invisionapp\.com\/share\/.*)$/;
|
||||
|
||||
const IMAGE_REGEX = new RegExp(
|
||||
"^https://(opal.invisionapp.com/static-signed/live-embed/.*)$"
|
||||
);
|
||||
const IMAGE_REGEX = /^https:\/\/(opal\.invisionapp\.com\/static-signed\/live-embed\/.*)$/;
|
||||
|
||||
type Props = {|
|
||||
isSelected: boolean,
|
||||
|
|
Reference in New Issue