Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions challenges/single/NumericSQLInjection/feature.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Function to fetch station data
*
* @param int $id Station Id
*
* @return array Result of database query
*/
private function getWeatherInfo($id = null)
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This standalone file contains only a private method without a class definition. Private methods require a class context. Either this file should be included/required within a class, or the method visibility should be reconsidered based on its intended usage pattern.

Suggested change
private function getWeatherInfo($id = null)
function getWeatherInfo($id = null)

Copilot uses AI. Check for mistakes.
{

if ($id == null) {
return \jf::SQL("SELECT * FROM ".self::TABLE_NAME);
} else {
return \jf::SQL("SELECT * FROM ".self::TABLE_NAME. " WHERE station = ".$id); //Notice the concatenation
}
}