File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -597,9 +597,8 @@ public function rawCommand(string $command, bool $append = false): self
597597 */
598598 public function text (array $ options = []): self
599599 {
600- $ mandatoryKeys = ['text ' , 'geometry ' , 'textSize ' ];
601- foreach ($ options as $ key => $ v ) {
602- if (!isset ($ mandatoryKeys [$ key ])) {
600+ foreach (['text ' , 'geometry ' , 'textSize ' ] as $ key ) {
601+ if (!isset ($ options [$ key ])) {
603602 throw new \InvalidArgumentException (\sprintf ('Key "%s" is missing for the %s function. ' , $ key , __METHOD__ ));
604603 }
605604 }
@@ -624,7 +623,8 @@ public function text(array $options = []): self
624623 $ this ->stroke ('none ' );
625624
626625 $ this ->command [] = '-annotate ' ;
627- $ this ->command [] = '" ' .$ this ->ref ->geometry ($ geometry ).'" ' .$ text ;
626+ $ this ->command [] = '" ' .$ this ->ref ->geometry ($ geometry ).'" ' ;
627+ $ this ->command [] = \escapeshellarg ($ text );
628628
629629 return $ this ;
630630 }
You can’t perform that action at this time.
0 commit comments