Merge pull request #12596 from nupplaphil/bug/errors
Checks if the Photo order argument is a valid column
This commit is contained in:
commit
462625368f
1 changed files with 2 additions and 1 deletions
|
@ -31,6 +31,7 @@ use Friendica\Core\Logger;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
|
use Friendica\Database\DBStructure;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
|
@ -923,7 +924,7 @@ function photos_content(App $a)
|
||||||
|
|
||||||
if ($order_field === 'created') {
|
if ($order_field === 'created') {
|
||||||
$params = ['order' => [$order_field]];
|
$params = ['order' => [$order_field]];
|
||||||
} elseif (!empty($order_field)) {
|
} elseif (!empty($order_field) && DBStructure::existsColumn('photo', [$order_field])) {
|
||||||
$params = ['order' => [$order_field => true]];
|
$params = ['order' => [$order_field => true]];
|
||||||
} else {
|
} else {
|
||||||
$params = [];
|
$params = [];
|
||||||
|
|
Loading…
Reference in a new issue