@@ -106,14 +106,14 @@ |
||
| 106 | 106 | return false; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - //change the RGB values if you need, but leave alpha at 127 |
|
| 109 | + //change the RGB values if you need, but leave alpha at 127 |
|
| 110 | 110 | $transparent = imagecolorallocatealpha($dst, 255, 255, 255, 127); |
| 111 | 111 | |
| 112 | 112 | if ($transparent === false) { |
| 113 | 113 | return false; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - //simpler than flood fill |
|
| 116 | + //simpler than flood fill |
|
| 117 | 117 | if (imagefilledrectangle($dst, 0, 0, imagesx($image), imagesy($image), $transparent) === false) { |
| 118 | 118 | return false; |
| 119 | 119 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | * @param string $msg message to log |
| 22 | 22 | * @param string $style style (null | bold | italic) |
| 23 | 23 | * @return void |
| 24 | - */ |
|
| 24 | + */ |
|
| 25 | 25 | public function log($msg, $style = '') |
| 26 | 26 | { |
| 27 | 27 | $this->entries[] = [$msg, $style]; |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | * @param string $msg message to log |
| 19 | 19 | * @param string $style style (null | bold | italic) |
| 20 | 20 | * @return void |
| 21 | - */ |
|
| 21 | + */ |
|
| 22 | 22 | public function log($msg, $style = '') |
| 23 | 23 | { |
| 24 | 24 | $msg = htmlspecialchars($msg); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * Handle ln by echoing a <br> tag. |
| 36 | 36 | * |
| 37 | 37 | * @return void |
| 38 | - */ |
|
| 38 | + */ |
|
| 39 | 39 | public function ln() |
| 40 | 40 | { |
| 41 | 41 | echo '<br>'; |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | * @param string $msg message to log |
| 21 | 21 | * @param string $style style (null | bold | italic) |
| 22 | 22 | * @return void |
| 23 | - */ |
|
| 23 | + */ |
|
| 24 | 24 | abstract public function log($msg, $style = ''); |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @param string $msg message to log |
| 36 | 36 | * @param string $style style (null | bold | italic) |
| 37 | 37 | * @return void |
| 38 | - */ |
|
| 38 | + */ |
|
| 39 | 39 | public function logLn($msg, $style = '') |
| 40 | 40 | { |
| 41 | 41 | $this->log($msg, $style); |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | * |
| 65 | 65 | * @throws \WebPConvert\Convert\Exceptions\ConversionFailedException in case conversion fails |
| 66 | 66 | * @return void |
| 67 | - */ |
|
| 67 | + */ |
|
| 68 | 68 | public static function convert($source, $destination, $options = [], $logger = null) |
| 69 | 69 | { |
| 70 | 70 | Stack::convert($source, $destination, $options, $logger); |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | $this->addOption($option); |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | - /* |
|
| 46 | + /* |
|
| 47 | 47 | In some years, we can use the splat instead (requires PHP 5.6): |
| 48 | 48 | @param Option[] ...$options Array of options objects to add |
| 49 | 49 | public function addOptions(...$options) |
@@ -482,7 +482,7 @@ |
||
| 482 | 482 | if ($this->options[$optionName]) { |
| 483 | 483 | $this->logLn( |
| 484 | 484 | 'Discovering binaries ' . $description . ' ' . |
| 485 | - '(to skip this step, disable the "' . $optionName . '" option)' |
|
| 485 | + '(to skip this step, disable the "' . $optionName . '" option)' |
|
| 486 | 486 | ); |
| 487 | 487 | } else { |
| 488 | 488 | $this->logLn( |
@@ -15,22 +15,22 @@ |
||
| 15 | 15 | class PathChecker |
| 16 | 16 | { |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Check absolute file path to prevent attacks. |
|
| 20 | - * |
|
| 21 | - * - Prevents non printable characters |
|
| 22 | - * - Prevents stream wrappers |
|
| 23 | - * - Prevents directory traversal |
|
| 24 | - * |
|
| 25 | - * Preventing non printable characters is especially done to prevent the NUL character, which can be used |
|
| 26 | - * to bypass other tests. See https://st-g.de/2011/04/doing-filename-checks-securely-in-PHP. |
|
| 27 | - * |
|
| 28 | - * Preventeng stream wrappers is especially done to protect against Phar Deserialization. |
|
| 29 | - * See https://blog.ripstech.com/2018/new-php-exploitation-technique/ |
|
| 30 | - * |
|
| 31 | - * @param string $absFilePath |
|
| 32 | - * @return void |
|
| 33 | - */ |
|
| 18 | + /** |
|
| 19 | + * Check absolute file path to prevent attacks. |
|
| 20 | + * |
|
| 21 | + * - Prevents non printable characters |
|
| 22 | + * - Prevents stream wrappers |
|
| 23 | + * - Prevents directory traversal |
|
| 24 | + * |
|
| 25 | + * Preventing non printable characters is especially done to prevent the NUL character, which can be used |
|
| 26 | + * to bypass other tests. See https://st-g.de/2011/04/doing-filename-checks-securely-in-PHP. |
|
| 27 | + * |
|
| 28 | + * Preventeng stream wrappers is especially done to protect against Phar Deserialization. |
|
| 29 | + * See https://blog.ripstech.com/2018/new-php-exploitation-technique/ |
|
| 30 | + * |
|
| 31 | + * @param string $absFilePath |
|
| 32 | + * @return void |
|
| 33 | + */ |
|
| 34 | 34 | public static function checkAbsolutePath($absFilePath, $text = 'file') |
| 35 | 35 | { |
| 36 | 36 | if (empty($absFilePath)) { |