@@ -35,17 +35,23 @@ public function __construct(
3535
3636 if ( $ option_spec ->hasBlobValue () ) {
3737 if ( $ blob_value === null ) {
38- throw WsLog::ex (
39- 'Option ' . $ option_spec ->name .
40- ' must have a blob value, but a blob value was not provided. '
41- );
38+ $ msg = 'Option ' . $ option_spec ->name .
39+ ' must have a blob value, but a blob value was not provided. ' ;
40+ if ( defined ( 'STATIC_DEPLOY_ESCAPE_EXCEPTIONS ' )
41+ && STATIC_DEPLOY_ESCAPE_EXCEPTIONS ) {
42+ throw WsLog::ex ( esc_html ( $ msg ) );
43+ }
44+ throw WsLog::ex ( $ msg );
4245 }
4346 } else {
4447 if ( $ blob_value !== null && $ blob_value !== '' ) {
45- throw WsLog::ex (
46- 'Option ' . $ option_spec ->name .
47- ' cannot have a blob value, but a blob value was provided. '
48- );
48+ $ msg = 'Option ' . $ option_spec ->name .
49+ ' cannot have a blob value, but a blob value was provided. ' ;
50+ if ( defined ( 'STATIC_DEPLOY_ESCAPE_EXCEPTIONS ' )
51+ && STATIC_DEPLOY_ESCAPE_EXCEPTIONS ) {
52+ throw WsLog::ex ( esc_html ( $ msg ) );
53+ }
54+ throw WsLog::ex ( $ msg );
4955 }
5056 // We get blank strings instead of null from MySQL,
5157 // so we have to set null ourselves.
@@ -174,9 +180,12 @@ public static function fromUserInput(
174180 case 'object ' :
175181 $ json = json_decode ( stripcslashes ( strval ( $ user_input ) ) );
176182 if ( ! is_object ( $ json ) ) {
177- throw WsLog::ex (
178- 'Option ' . $ option_spec ->name . ' must be an object. '
179- );
183+ $ msg = 'Option ' . $ option_spec ->name . ' must be an object. ' ;
184+ if ( defined ( 'STATIC_DEPLOY_ESCAPE_EXCEPTIONS ' )
185+ && STATIC_DEPLOY_ESCAPE_EXCEPTIONS ) {
186+ throw WsLog::ex ( esc_html ( $ msg ) );
187+ }
188+ throw WsLog::ex ( $ msg );
180189 }
181190 $ blob_value = json_encode ( $ json );
182191 $ value = '1 ' ;
@@ -189,10 +198,13 @@ public static function fromUserInput(
189198 $ value = esc_url_raw ( strval ( $ user_input ) );
190199 break ;
191200 default :
192- throw WsLog::ex (
193- 'Unknown option type: ' . $ option_spec ->type
194- . ' for option: ' . $ option_spec ->name
195- );
201+ $ msg = 'Unknown option type: ' . $ option_spec ->type
202+ . ' for option: ' . $ option_spec ->name ;
203+ if ( defined ( 'STATIC_DEPLOY_ESCAPE_EXCEPTIONS ' )
204+ && STATIC_DEPLOY_ESCAPE_EXCEPTIONS ) {
205+ throw WsLog::ex ( esc_html ( $ msg ) );
206+ }
207+ throw WsLog::ex ( $ msg );
196208 }
197209
198210 return new self (
0 commit comments