You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Cron_Command.php
+10-4Lines changed: 10 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,7 @@ public function add( $args, $assoc_args ) {
89
89
}
90
90
}
91
91
92
-
$this->semi_colon_check( $command );
92
+
$this->validate_command( $command );
93
93
$command = $this->add_sh_c_wrapper( $command );
94
94
95
95
EE::db()->insert(
@@ -171,7 +171,7 @@ public function update( $args, $assoc_args ) {
171
171
$data_to_update['sitename'] = $site;
172
172
}
173
173
if ( $command ) {
174
-
$this->semi_colon_check( $command );
174
+
$this->validate_command( $command );
175
175
$command = $this->add_sh_c_wrapper( $command );
176
176
$data_to_update['command'] = $command;
177
177
}
@@ -332,12 +332,18 @@ private function site_php_container( $site ) {
332
332
returnstr_replace( '.', '', $site ) . '_php_1';
333
333
}
334
334
335
-
privatefunctionsemi_colon_check( $command ) {
336
-
// Semicolons in commands do not work for now due to limitation of INI style config ofelia uses
335
+
/**
336
+
* Ensures given command will not create problem with INI syntax
337
+
*/
338
+
privatefunctionvalidate_command( $command ) {
339
+
// Semicolons and Hash(#) in commands do not work for now due to limitation of INI style config ofelia uses
337
340
// See https://github.com/EasyEngine/cron-command/issues/4
338
341
if ( strpos( $command, ';' ) !== false ) {
339
342
EE::error( 'Command chaining using `;` - semi-colon is not supported currently. You can either use `&&` or `||` or creating a second cron job for the chained command.' );
340
343
}
344
+
if ( strpos( $command, '#' ) !== false ) {
345
+
EE::error( 'EasyEngine does not support commands with #' );
0 commit comments