Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.3] Improve scheduler's parameter escaping #16088

Merged
merged 1 commit into from
Oct 24, 2016

Conversation

inxilpro
Copy link
Contributor

Addresses #15996 by adding the following logic:

  • If a parameter value is an array, escape each item and return a space-delimited list (implements input arrays)
  • If a parameter is_numeric or if a parameter looks like an option (i.e. -a or --append), then leave it as-is
  • Otherwise, escape all arguments

This means that:

  • $schedule->command('my:command', ['-10 minutes']); results in php artisan my:command '-10 minutes'
  • $schedule->command('my:command', ['-a', '-w']); results in php artisan my:command -a -w
  • $schedule->command('my:command', [['one', 'two', 'three']]); results in php artisan my:command 'one' 'two' 'three'

(Was initially submitted as PR 16015 but I'm resubmitting it against 5.3 per @taylorotwell's comment.)

@taylorotwell taylorotwell merged commit 7cc2574 into laravel:5.3 Oct 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants