add function to safely end output buffering
This commit is contained in:
parent
c38a75e03f
commit
59d5aa2cb7
15
lib/util.php
15
lib/util.php
|
@ -594,22 +594,31 @@ class OC_Util {
|
||||||
$connected = @fsockopen("www.owncloud.org", 80);
|
$connected = @fsockopen("www.owncloud.org", 80);
|
||||||
if ($connected) {
|
if ($connected) {
|
||||||
fclose($connected);
|
fclose($connected);
|
||||||
return true;
|
return true;
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
// second try in case one server is down
|
// second try in case one server is down
|
||||||
$connected = @fsockopen("apps.owncloud.com", 80);
|
$connected = @fsockopen("apps.owncloud.com", 80);
|
||||||
if ($connected) {
|
if ($connected) {
|
||||||
fclose($connected);
|
fclose($connected);
|
||||||
return true;
|
return true;
|
||||||
}else{
|
}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
|
* @brief Generates a cryptographical secure pseudorandom string
|
||||||
|
|
Loading…
Reference in New Issue