You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #1021 from CassianoRafael/master
Title: Prevent Potential Null Issue and Warnings in rawAddPrefix (#1021)
Description:
This pull request addresses a potential issue in the rawAddPrefix method of the PHP-MySQLi-Database-Class. In newer PHP versions, accessing properties of potentially null variables can trigger warnings.
Issue:
If the provided SQL query doesn't contain keywords like "FROM," "INTO," "UPDATE," "JOIN," or "DESCRIBE" (e.g., functions and procedures), the $table array used for prefixing might be empty. This could lead to:
PHP Deprecated Warnings: Accessing properties of a potentially null $table array can cause warnings in newer PHP versions.
Unexpected Behavior: An empty $table array could result in unexpected behavior when adding prefixes.
Fix:
This pull request introduces a conditional check to ensure there are table name matches before proceeding with prefix replacement. This prevents the $table array from being null and avoids potential warnings and unexpected behavior.
Benefits:
Improves code robustness and prevents warnings in newer PHP environments.
Enhances code clarity and maintainability.
Additional Notes:
This is a valuable contribution by first-time contributor @CassianoRafael (thanks!).
0 commit comments