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

Mime.php has misleading code #125

Open
jesseforrest opened this issue Oct 15, 2021 · 0 comments
Open

Mime.php has misleading code #125

jesseforrest opened this issue Oct 15, 2021 · 0 comments

Comments

@jesseforrest
Copy link

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;
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

No branches or pull requests

1 participant