summaryrefslogtreecommitdiffstats
path: root/application/controllers
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2011-06-04 21:42:44 +0200
committerFlorian Pritz <bluewind@xinu.at>2011-06-04 21:44:39 +0200
commitc19a41faa3c81a7670b9f9e0c621c2254f7068f7 (patch)
tree026554a0245eff15d7a4413f5386f949bbb1a067 /application/controllers
parent7dfc1fd5ece8bb61af0bd0d41685abb51df3eff0 (diff)
refactor cli client check
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers')
-rw-r--r--application/controllers/file.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php
index ad70eeef9..fb219f67f 100644
--- a/application/controllers/file.php
+++ b/application/controllers/file.php
@@ -19,10 +19,12 @@ class File extends CI_Controller {
$this->var->latest_client = trim(file_get_contents(FCPATH.'data/client/latest'));
// official client uses "fb-client/$version" as useragent
- if (strpos($_SERVER['HTTP_USER_AGENT'], 'fb-client') !== false) {
- $this->var->cli_client = "fb-client";
- } elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'libcurl') !== false) {
- $this->var->cli_client = "curl";
+ $clients = array("fb-client", "libcurl", "pyfb");
+ foreach ($clients as $client) {
+ if (strpos($_SERVER['HTTP_USER_AGENT'], $client) !== false) {
+ $this->var->cli_client = true;
+ break;
+ }
}
if ($this->var->cli_client) {