diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index 335317421a2..eaa173eb6fe 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -1203,32 +1203,32 @@ function delDocumentModel($name, $type)
}
-/**
- * Return the php_info into an array
- *
- * @return array Array with PHP infos
- */
-function phpinfo_array()
-{
- ob_start();
- phpinfo();
- $info_arr = array();
- $info_lines = explode("\n", strip_tags(ob_get_clean(), "
")); // end of ob_start()
- $cat = "General";
- foreach($info_lines as $line)
- {
- // new cat?
- preg_match("~(.*)~", $line, $title) ? $cat = $title[1] : null;
- if(preg_match("~| ]+>([^<]*) | ]+>([^<]*) | ~", $line, $val))
- {
- $info_arr[trim($cat)][trim($val[1])] = $val[2];
- }
- elseif(preg_match("~| ]+>([^<]*) | ]+>([^<]*) | ]+>([^<]*) | ~", $line, $val))
- {
- $info_arr[trim($cat)][trim($val[1])] = array("local" => $val[2], "master" => $val[3]);
- }
+/**
+ * Return the php_info into an array
+ *
+ * @return array Array with PHP infos
+ */
+function phpinfo_array()
+{
+ ob_start();
+ phpinfo();
+ $info_arr = array();
+ $info_lines = explode("\n", strip_tags(ob_get_clean(), "")); // end of ob_start()
+ $cat = "General";
+ foreach($info_lines as $line)
+ {
+ // new cat?
+ preg_match("~(.*)~", $line, $title) ? $cat = $title[1] : null;
+ if(preg_match("~| ]+>([^<]*) | ]+>([^<]*) | ~", $line, $val))
+ {
+ $info_arr[trim($cat)][trim($val[1])] = $val[2];
+ }
+ elseif(preg_match("~| ]+>([^<]*) | ]+>([^<]*) | ]+>([^<]*) | ~", $line, $val))
+ {
+ $info_arr[trim($cat)][trim($val[1])] = array("local" => $val[2], "master" => $val[3]);
+ }
}
- return $info_arr;
+ return $info_arr;
}
?>
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index b2687ee66fa..3430605357f 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -589,7 +589,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
// Define $sqlwhere
$sqlwhere='';
- $yearoffset=0; // Use year of current $date by default
+ $yearoffset=0; // Use year of current $date by default
$yearoffsettype=false;
// If a restore to zero after a month is asked we check if there is already a value for this year.
@@ -635,19 +635,14 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
$nextnewyeardate=dol_mktime('0','0','0','1','1',$currentyear+1);
//echo 'currentyear='.$currentyear.' date='.dol_print_date($date, 'day').' fiscaldate='.dol_print_date($fiscaldate, 'day').' ';
- if ($date >= $fiscaldate) // If after or equal current fiscal date
+ // If after or equal of current fiscal date
+ if ($date >= $fiscaldate)
{
- if ($date < $nextnewyeardate) // If before of next new year date
- {
- if ($yearoffsettype == '-') $yearoffset=0;
- else if ($yearoffsettype == '+') $yearoffset=1;
- }
+ // If before of next new year date
+ if ($date < $nextnewyeardate && $yearoffsettype == '+') $yearoffset=1;
}
- else if ($date >= $newyeardate) // If after or equal of current new year date
- {
- if ($yearoffsettype == '-') $yearoffset=-1;
- else if ($yearoffsettype == '+') $yearoffset=0;
- }
+ // If after or equal of current new year date
+ else if ($date >= $newyeardate && $yearoffsettype == '-') $yearoffset=-1;
}
// For backward compatibility
else if (date("m",$date) < $maskraz) { $yearoffset=-1; } // If current month lower that month of return to zero, year is previous year
| |