|
Comments for: rasmus19990124
| Message # 1510263: |
|
Date: 09/29/07 19:27
By: Tagg Subject: Safer coding To implement safer coding, one might replace line #2: if(!isset($s)) $s=11; with: $s = (isset($_GET['s'])) ? $_GET['s'] : 11; $s = preg_replace('/\D/', '', $s); $text = (isset($_GET['text'])) ? $_GET['text'] : 'Unintentionally left blank'; $text = preg_replace('/[^ \w]/', '', $text); $ttf = 'path.to.font.file/TIMES.TTF'; and replace the hardcoded .TTF constants with the $ttf string. Using preg_replace() to accept only decimal numbers for $s and only word characters for $text ensures the processing of only anticipated values. |
Previous Message | Next Message |


