| @@ 146-161 (lines=16) @@ | ||
| 143 | * |
|
| 144 | * @return bool True if set, false if invalid. |
|
| 145 | */ |
|
| 146 | public function set_rfc($idea_id, $rfc) |
|
| 147 | { |
|
| 148 | $match = '/^https?:\/\/area51\.phpbb\.com\/phpBB\/viewtopic\.php/'; |
|
| 149 | if ($rfc && !preg_match($match, $rfc)) |
|
| 150 | { |
|
| 151 | return false; |
|
| 152 | } |
|
| 153 | ||
| 154 | $sql_ary = array( |
|
| 155 | 'rfc_link' => $rfc, // string is escaped by build_array() |
|
| 156 | ); |
|
| 157 | ||
| 158 | $this->update_idea_data($sql_ary, $idea_id, $this->table_ideas); |
|
| 159 | ||
| 160 | return true; |
|
| 161 | } |
|
| 162 | ||
| 163 | /** |
|
| 164 | * Sets the ticket ID of an idea. |
|
| @@ 195-210 (lines=16) @@ | ||
| 192 | * |
|
| 193 | * @return bool True if set, false if invalid. |
|
| 194 | */ |
|
| 195 | public function set_implemented($idea_id, $version) |
|
| 196 | { |
|
| 197 | $match = '/^\d\.\d\.\d+(\-\w+)?$/'; |
|
| 198 | if ($version && !preg_match($match, $version)) |
|
| 199 | { |
|
| 200 | return false; |
|
| 201 | } |
|
| 202 | ||
| 203 | $sql_ary = array( |
|
| 204 | 'implemented_version' => $version, // string is escaped by build_array() |
|
| 205 | ); |
|
| 206 | ||
| 207 | $this->update_idea_data($sql_ary, $idea_id, $this->table_ideas); |
|
| 208 | ||
| 209 | return true; |
|
| 210 | } |
|
| 211 | ||
| 212 | /** |
|
| 213 | * Sets the title of an idea. |
|