Secure coding guidelines/42/zh-tw: Difference between revisions
From Joomla! Documentation
Created page with "// For SQL data types: FLOAT, DOUBLE $query = 'SELECT * FROM #__table WHERE `id`=' . (float) $id; </source> It's a good idea to get into the habit of always typecasting intege..." |
No edit summary |
||
| Line 2: | Line 2: | ||
$query = 'SELECT * FROM #__table WHERE `id`=' . (float) $id; | $query = 'SELECT * FROM #__table WHERE `id`=' . (float) $id; | ||
</source> | </source> | ||
總是對使用 <cdoe> JInput->getInt</code>獲得的變數進行整數型別轉換,絕對是個好習慣。關於 SQL 注入攻擊更進一步的資訊,可以在 http://php.net/manual/en/security.database.sql-injection.php 以及 [[Retrieving_request_data_using_JInput#Getting_Values]] 找到。 | |||
Latest revision as of 07:50, 14 January 2021
// For SQL data types: FLOAT, DOUBLE $query = 'SELECT * FROM #__table WHERE `id`=' . (float) $id; </source> 總是對使用 <cdoe> JInput->getInt獲得的變數進行整數型別轉換,絕對是個好習慣。關於 SQL 注入攻擊更進一步的資訊,可以在 http://php.net/manual/en/security.database.sql-injection.php 以及 Retrieving_request_data_using_JInput#Getting_Values 找到。