openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit f8a73a6de99679e20f820767dc499c6a619cb4d8
parent 6cd069b74f54a39afa5e6da3212da640f1148006
Author: Jan Dankert <devnull@localhost>
Date:   Tue, 30 Oct 2012 11:00:50 +0100

Fix: Default für Filename-Style korrigiert (Überflüssige Leerzeichen entfernt). Zusätzlich Fallback, falls Style unbekannt.

Diffstat:
config/config-default.php | 13+++++--------
model/Object.class.php | 20+++++++++++++-------
2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/config/config-default.php b/config/config-default.php @@ -270,15 +270,12 @@ $conf['editor']['text']['linelength']='70'; $conf['editor']['macro'] = array(); $conf['editor']['macro']['show_errors']=false; $conf['filename'] = array(); -$conf['filename']['edit']='true '; -$conf['filename']['default']='index '; -$conf['filename']['style']='ss '; -$conf['filename']['style']='id '; -$conf['filename']['style']='longid '; -$conf['filename']['style']='short '; -$conf['filename']['url']='relative '; +$conf['filename']['edit']=true; +$conf['filename']['default']='index'; +$conf['filename']['style']='short'; +$conf['filename']['url']='relative'; $conf['ftp'] = array(); -$conf['ftp']['ascii']= "html,htm,php "; +$conf['ftp']['ascii']= "html,htm,php"; $conf['help'] = array(); $conf['help']['enabled']=true; $conf['help']['url']="http://help.openrat.de/"; diff --git a/model/Object.class.php b/model/Object.class.php @@ -416,9 +416,12 @@ SQL $this->filename = base_convert($this->objectid,10,36); break; -// case 'md5': -// $this->filename = md5(md5($this->objectid)); -// break; + case 'md5': + // MD5-Summe als Dateinamen verwenden + // Achtung: Kollisionen sind unwahrscheinlich, aber theoretisch möglich. + $this->filename = md5(md5($this->objectid)); + break; + case 'ss': // Imitieren von "StoryServer" URLs. Wers braucht. $this->filename = '0,'. @@ -427,12 +430,15 @@ SQL base_convert(str_pad($this->objectid,7,'a'),11,10). ',00'; break; -// case 'title': -// $this->filename = $this->goodFilename(trim(strtolower($this->name))); -// break; + + case 'title': + // Achtung: Kollisionen sind möglich. + $this->filename = $this->goodFilename(trim(strtolower($this->name))); + break; default: - die('Unknown filename style: '.$conf['filename']['style'] ); + // Als Fallback die Objekt-Id als Dateinamen verwenden. + $this->filename = $this->objectid; } }