phpvideotoolkit-v2
phpvideotoolkit-v2 copied to clipboard
Mime.php has misleading code
We use phpvideotoolkit in production and log warnings to ensure our code doesn't have any issues. We are receiving the following warning:
Got error 'PHP message: PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /vendor/buggedcom/phpvideotoolkit/src/PHPVideoToolkit/Mime.php on line 189'
Looking into it, the warning is valid and the code has the following confusing logic:
default:
// date, ldate, ledate, leldate, beldate, lebelbe...
continue;
Depending on the intended behavior that code should be changed to either:
A) If you want to keep the current behavior
default:
// date, ldate, ledate, leldate, beldate, lebelbe...
break;
B) If the logic is supposed to intentionally skip to the next foreach iteration and not add anything to $mime_magic_data[] then it should be the following
default:
// date, ldate, ledate, leldate, beldate, lebelbe...
continue 2;