Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- Moved the email/secretKey and custom url to have a check
Signed-off-by: Joe Stump <joe@joestump.net>
  • Loading branch information
David Coallier authored and joestump committed Apr 28, 2009
1 parent 779a536 commit 88de0d8
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Services/ShortURL/shortie.php
Expand Up @@ -52,12 +52,19 @@ public function shorten($url)
'private' => isset($this->options['private'])
? $this->options['private']
: 'false',

'email' => $this->options['email'],
'secretKey' => $this->options['secretKey'],
'custom' => $this->options['custom'],
);

// If the email and secret key is passed, use it.
if (isset($this->options['email']) && isset($this->options['secretKey'])) {
$params['email'] = $this->options['email'];
$params['secretKey'] = $this->options['secretKey'];
}

// If it's a custom url, use it.
if (isset($this->options['custom'])) {
$params['custom'] = $this->options['custom'];
}

$sets = array();
foreach ($params as $key => $val) {
$sets[] = $key . '=' . $val;
Expand Down

0 comments on commit 88de0d8

Please sign in to comment.