summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-11-29 17:58:24 +0100
committerRobin Appelman <icewind@owncloud.com>2012-11-29 17:58:24 +0100
commit59d5aa2cb74b605700c6a142409937fa65e8af72 (patch)
treec961776ef3e5307b2ca258a136dcc4633edcd896 /lib
parentc38a75e03f9db02b82e71472d2f719079eb44829 (diff)
downloadnextcloud-server-59d5aa2cb74b605700c6a142409937fa65e8af72.tar.gz
nextcloud-server-59d5aa2cb74b605700c6a142409937fa65e8af72.zip
add function to safely end output buffering
Diffstat (limited to 'lib')
-rwxr-xr-xlib/util.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/util.php b/lib/util.php
index adec69248d5..2ee3f0e4efb 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -594,22 +594,31 @@ class OC_Util {
$connected = @fsockopen("www.owncloud.org", 80);
if ($connected) {
fclose($connected);
- return true;
+ return true;
}else{
// second try in case one server is down
$connected = @fsockopen("apps.owncloud.com", 80);
if ($connected) {
fclose($connected);
- return true;
+ return true;
}else{
- return false;
+ return false;
}
}
}
+ /**
+ * clear all levels of output buffering
+ */
+ public static function obEnd(){
+ while (ob_get_level()) {
+ ob_end_clean();
+ }
+ }
+
/**
* @brief Generates a cryptographical secure pseudorandom string