File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -45,12 +45,20 @@ class EmbeddedGateway extends React.Component {
4545 container = div
4646 }
4747
48- if ( component ) {
48+ if ( component != null && getComponent ( component ) === null ) {
49+ element . innerHTML = "<h1>Data Viz Error </h1><h4>Component<i> " + component + "</i> not found</h4><br>"
50+ } else if ( component && getComponent ( component ) ) {
4951 const props = { ...this . props }
5052 const attrs = element . attributes
5153 for ( let i = attrs . length - 1 ; i >= 0 ; i -- ) {
5254 props [ attrs [ i ] . name ] = attrs [ i ] . value ;
5355 }
56+
57+ element . getAttributeNames ( ) . forEach ( ( name ) => {
58+ if ( name . startsWith ( 'data-' ) ) {
59+ element . removeAttribute ( name ) ;
60+ }
61+ } ) ;
5462 const C = injectIntl ( getComponent ( component ) ) ;
5563 if ( C ) {
5664 ReactDOM . createRoot ( container )
Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ const localReplaceLink = (url, locale) => {
1616 if ( ! pathname . startsWith ( "/wp/" ) ) {
1717 return url ; // Not a WordPress path, leave unchanged
1818 }
19+ //ensuring access to media library files
20+ if ( pathname . startsWith ( "/wp/wp-content" ) ) {
21+ return url
22+ }
1923
2024 const afterWp = pathname . slice ( 3 ) ; // remove '/wp'
2125
You can’t perform that action at this time.
0 commit comments