summaryrefslogtreecommitdiff
path: root/includes/ZhClient.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/ZhClient.php')
-rw-r--r--includes/ZhClient.php11
1 files changed, 3 insertions, 8 deletions
diff --git a/includes/ZhClient.php b/includes/ZhClient.php
index 8bb36b23..d3d79165 100644
--- a/includes/ZhClient.php
+++ b/includes/ZhClient.php
@@ -41,10 +41,7 @@ class ZhClient {
$errno = $errstr = '';
$this->mFP = fsockopen( $this->mHost, $this->mPort, $errno, $errstr, 30 );
wfRestoreWarnings();
- if ( !$this->mFP ) {
- return false;
- }
- return true;
+ return !$this->mFP;
}
/**
@@ -77,10 +74,7 @@ class ZhClient {
$data .= $str;
}
// data should be of length $len. otherwise something is wrong
- if ( strlen( $data ) != $len ) {
- return false;
- }
- return $data;
+ return strlen( $data ) == $len;
}
/**
@@ -124,6 +118,7 @@ class ZhClient {
}
return $ret;
}
+
/**
* Perform word segmentation
*