| @@ -1242,11 +1242,18 @@ | ||
| 1242 | 1242 | if ( empty( $snippet_code ) ) { |
| 1243 | 1243 | return true; |
| 1244 | 1244 | } |
| 1245 | 1245 | |
| 1246 | - $redeclaration = WINP_Code_Validator::find_redeclaration( $snippet_code, $snippet_type ); | |
| 1246 | + $redeclaration = WINP_Code_Validator::find_function_redeclaration( $snippet_code, $snippet_type ); | |
| 1247 | 1247 | if ( null !== $redeclaration ) { |
| 1248 | - $this->display_validation_error( $redeclaration['line'], WINP_Code_Validator::get_redeclaration_message( $redeclaration ) ); | |
| 1248 | + $this->display_validation_error( | |
| 1249 | + $redeclaration['line'], | |
| 1250 | + sprintf( | |
| 1251 | + // translators: %s is the fully qualified function name. | |
| 1252 | + __( 'Cannot redeclare function %s(). Rename the function or guard its declaration with function_exists().', 'insert-php' ), | |
| 1253 | + $redeclaration['name'] | |
| 1254 | + ) | |
| 1255 | + ); | |
| 1249 | 1256 | return false; |
| 1250 | 1257 | } |
| 1251 | 1258 | |
| 1252 | 1259 | // Set custom error handler to catch warnings and notices. |