Skip to content

Commit 76301a7

Browse files
committed
Fix issue evaluating content snippet code with unclosed PHP tags.
1 parent 1e0cc8b commit 76301a7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/js/utils/restAPI.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { trimTrailingChar } from './text'
22
import type { AxiosRequestConfig } from 'axios'
33

4+
export const REST_BASE = trimTrailingChar(window.CODE_SNIPPETS?.restAPI.base ?? '', '/')
45
export const REST_SNIPPETS_BASE = trimTrailingChar(window.CODE_SNIPPETS?.restAPI.snippets ?? '', '/')
56

67
export const REST_API_AXIOS_CONFIG: AxiosRequestConfig = {

src/php/front-end/class-front-end.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ protected function evaluate_shortcode_content( Snippet $snippet, array $atts ):
249249
extract( $atts );
250250

251251
ob_start();
252-
eval( "?>\n\n" . $snippet->code . "\n\n<?php" );
252+
eval( "?>\n\n" . $snippet->code );
253253

254254
return ob_get_clean();
255255
}

0 commit comments

Comments
 (0)