CC-2950: Tell users if they are running an out-of-date version or not
- added error checking to curl call - added regex validation when storing link to latest version
This commit is contained in:
parent
eae90862b1
commit
52052bd573
2 changed files with 18 additions and 5 deletions
|
@ -530,14 +530,19 @@ class Application_Model_Preference
|
|||
public static function GetLatestLink(){
|
||||
$link = self::GetValue("latest_link");
|
||||
if($link == null || strlen($link) == 0) {
|
||||
return "";
|
||||
return "http://www.sourcefabric.org/en/airtime/download/";
|
||||
} else {
|
||||
return $link;
|
||||
}
|
||||
}
|
||||
|
||||
public static function SetLatestLink($link){
|
||||
self::SetValue("latest_link", $link);
|
||||
$pattern = "#^(http|https|ftp)://" .
|
||||
"([a-zA-Z0-9]+\.)*[a-zA-Z0-9]+" .
|
||||
"(/[a-zA-Z0-9\-\.\_\~\:\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=]+)*/?$#";
|
||||
if(preg_match($pattern, $link)) {
|
||||
self::SetValue("latest_link", $link);
|
||||
}
|
||||
}
|
||||
|
||||
public static function SetUploadToSoundcloudOption($upload) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue