diff options
author | Andreas Gohr <andi@splitbrain.org> | 2013-01-18 10:52:26 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2013-01-18 10:52:26 +0100 |
commit | 004e7e6efb2e8da1d76f3959667ca0dbf8b0aaf6 (patch) | |
tree | e67de0d5a7ced678f92a3703610ccd2d63563234 | |
parent | edf986ad6271abac1f00055d3de4a9857cae1553 (diff) | |
download | rpg-004e7e6efb2e8da1d76f3959667ca0dbf8b0aaf6.tar.gz rpg-004e7e6efb2e8da1d76f3959667ca0dbf8b0aaf6.tar.bz2 |
simplified subscription->add() code a bit
-rw-r--r-- | inc/subscription.php | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/inc/subscription.php b/inc/subscription.php index 92c1e8579..e888ee27f 100644 --- a/inc/subscription.php +++ b/inc/subscription.php @@ -204,20 +204,16 @@ class Subscription { // delete any existing subscription $this->remove($id, $user); - $user = auth_nameencode(trim($user)); + $user = auth_nameencode(trim($user)); $style = trim($style); - $data = trim($data); + $data = trim($data); if(!$user) throw new Exception('no subscription user given'); if(!$style) throw new Exception('no subscription style given'); if(!$data) $data = time(); //always add current time for new subscriptions - $line = "$user $style"; - if($data) $line .= " $data"; - $line .= "\n"; - + $line = "$user $style $data\n"; $file = $this->file($id); - return io_saveFile($file, $line, true); } |