1
0

Added new programs - fixed a few things ....

This commit is contained in:
2014-08-04 20:10:58 +02:00
parent f8df6da103
commit 59d911e682
16 changed files with 54 additions and 26 deletions

View File

@@ -117,7 +117,7 @@ class BlogPost extends CActiveRecord
$name = str_replace(' ', '_', $name);
$name = preg_replace("/[^A-Za-z0-9_]/", '', $name);
return '/blog/' . $this->ID . '/' . $name;
return '/blog/' . $this->ID . '/' . rawurlencode($name);
}
/**

View File

@@ -163,7 +163,7 @@ class Program extends CActiveRecord
*/
public function getImagePath() {
if (file_exists('images/programs/thumbnails/' . $this->Name . '.png'))
return '/images/programs/thumbnails/' . $this->Name . '.png';
return '/images/programs/thumbnails/' . rawurlencode($this->Name) . '.png';
// else if (file_exists('images/programs/thumbnails/' . $this->Name . '.jpg'))
// return '/images/programs/thumbnails/' . $this->Name . '.jpg';
else throw new CHttpException(500, "Could not find Program Thumbnail '" . $this->Name . "'");
@@ -173,14 +173,14 @@ class Program extends CActiveRecord
* @return string
*/
public function getLink() {
return '/programs/view/' . $this->Name;
return '/programs/view/' . rawurlencode($this->Name);
}
/**
* @return string
*/
public function getDownloadLink() {
return '/programs/download/' . $this->Name;
return '/programs/download/' . rawurlencode($this->Name);
}
/**
@@ -188,7 +188,7 @@ class Program extends CActiveRecord
*/
public function getDirectDownloadLink() {
if ($this->download_url == 'direkt' || is_null($this->download_url) || empty($this->download_url))
return '/data/programs/' . $this->Name . '.zip';
return '/data/programs/' . rawurlencode($this->Name) . '.zip';
else
return $this->download_url;
}