Merge pull request #8116 from annando/archive
The archive functionality is working again
This commit is contained in:
commit
4156669c3f
|
@ -54,7 +54,7 @@ function network_init(App $a)
|
||||||
|
|
||||||
if ($a->argc > 1) {
|
if ($a->argc > 1) {
|
||||||
for ($x = 1; $x < $a->argc; $x ++) {
|
for ($x = 1; $x < $a->argc; $x ++) {
|
||||||
if (DI::dtFormat()->isYearMonth($a->argv[$x])) {
|
if (DI::dtFormat()->isYearMonthDay($a->argv[$x])) {
|
||||||
$is_a_date_query = true;
|
$is_a_date_query = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -440,7 +440,7 @@ function networkThreadedView(App $a, $update, $parent)
|
||||||
|
|
||||||
if ($a->argc > 1) {
|
if ($a->argc > 1) {
|
||||||
for ($x = 1; $x < $a->argc; $x ++) {
|
for ($x = 1; $x < $a->argc; $x ++) {
|
||||||
if (DI::dtFormat()->isYearMonth($a->argv[$x])) {
|
if (DI::dtFormat()->isYearMonthDay($a->argv[$x])) {
|
||||||
if ($datequery) {
|
if ($datequery) {
|
||||||
$datequery2 = Strings::escapeHtml($a->argv[$x]);
|
$datequery2 = Strings::escapeHtml($a->argv[$x]);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -181,4 +181,25 @@ class DateTimeFormat
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks, if the given string is a date with the pattern YYYY-MM-DD
|
||||||
|
*
|
||||||
|
* @param string $dateString The given date
|
||||||
|
*
|
||||||
|
* @return boolean True, if the date is a valid pattern
|
||||||
|
*/
|
||||||
|
public function isYearMonthDay(string $dateString)
|
||||||
|
{
|
||||||
|
$date = DateTime::createFromFormat('Y-m-d', $dateString);
|
||||||
|
if (!$date) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DateTime::getLastErrors()['error_count'] || DateTime::getLastErrors()['warning_count']) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user