Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ RUN mkdir -p wp-content/plugins \
RUN chown -R 82:82 wp-content \
&& tar -caf /wp-content.tgz --exclude="**/node_modules" wp-content

FROM wordpress:7.0.2-fpm-alpine AS runtime
FROM wordpress:7.1.0-fpm-alpine AS runtime
Comment thread
timothygachengo marked this conversation as resolved.
LABEL org.opencontainers.image.description="WordPress image for Data Viz"
LABEL org.opencontainers.image.authors="Development Gateway <info@developmentgateway.org>"
LABEL org.opencontainers.image.url="https://github.com/devgateway/data-viz-wordpress"
Expand Down
14 changes: 11 additions & 3 deletions plugins/wp-react-blocks-plugin/blocks/format-bar/infotooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ import {info as linkIcon} from '@wordpress/icons';
import {Button, Modal, Panel, PanelBody, PanelRow, Popover, TextareaControl} from '@wordpress/components';
import { BLOCKS_NS } from '@devgateway/dvz-wp-commons';

function safeDecodeURIComponent(text) {
try {
return decodeURIComponent(text);
} catch (e) {
return text;
}
}

const name = BLOCKS_NS + '/info-tooltip';
const reference = {
name,
Expand All @@ -35,7 +43,7 @@ const PopUI = ({onClose, onCancel}) => {
return <Modal title={__("Reference")} onRequestClose={e => onCancel()}>
<TextareaControl
label={__("Description")}
value={decodeURIComponent(text)}
value={safeDecodeURIComponent(text)}
onChange={(value) => setText(encodeURIComponent(value))}
/>

Expand Down Expand Up @@ -91,8 +99,8 @@ function InlineUI({value, onChange, activeObjectAttributes, contentRef, onClose}
<TextareaControl
rows={5}
label={__("Description")}
value={decodeURIComponent (content)}
onChange={(content) => setContent(content)}
value={safeDecodeURIComponent(content)}
onChange={(newValue) => setContent(encodeURIComponent(newValue))}
/>
</PanelRow>
<PanelRow>
Expand Down
14 changes: 11 additions & 3 deletions plugins/wp-react-blocks-plugin/blocks/format-bar/references.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ import {
SelectControl
} from '@wordpress/components';

function safeDecodeURIComponent(text) {
try {
return decodeURIComponent(text);
} catch (e) {
return text;
}
}

const name = BLOCKS_NS + '/reference';
const reference = {
name,
Expand Down Expand Up @@ -81,7 +89,7 @@ const PopUI = ({onClose, onCancel, value}) => {
<TextareaControl
label={__("Description")}
help={__("Enter reference description ")}
value={decodeURIComponent(text)}
value={safeDecodeURIComponent(text)}
onChange={(value) => setText(encodeURIComponent(value))}
/>
<TextControl value={link} label={__("URL")}
Expand Down Expand Up @@ -151,8 +159,8 @@ function InlineUI({value, onChange, activeObjectAttributes, contentRef, onClose}
className="block-editor-format-toolbar__image-container-value"

label={__("Description")}
value={decodeURIComponent(content)}
onChange={(content) => setContent(content)}
value={safeDecodeURIComponent(content)}
onChange={(newValue) => setContent(encodeURIComponent(newValue))}
/>
</PanelRow>
<PanelRow>
Expand Down
Loading