Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
hubzilla
core
Commits
032b6f19
Commit
032b6f19
authored
Mar 21, 2017
by
Zot
Committed by
Mario
Mar 29, 2017
Browse files
photos_album_exists() requires an observer to work correctly; provide it.
parent
e49c5995
Changes
2
Hide whitespace changes
Inline
Side-by-side
Zotlabs/Module/Photos.php
View file @
032b6f19
...
...
@@ -95,7 +95,7 @@ class Photos extends \Zotlabs\Web\Controller {
$album
=
argv
(
3
);
if
(
!
photos_album_exists
(
$page_owner_uid
,
$album
))
{
if
(
!
photos_album_exists
(
$page_owner_uid
,
get_observer_hash
(),
$album
))
{
notice
(
t
(
'Album not found.'
)
.
EOL
);
goaway
(
z_root
()
.
'/'
.
$_SESSION
[
'photo_return'
]);
}
...
...
@@ -681,7 +681,7 @@ class Photos extends \Zotlabs\Web\Controller {
\
App
::
$page
[
'htmlhead'
]
.
=
"
\r\n
"
.
'<link rel="alternate" type="application/json+oembed" href="'
.
z_root
()
.
'/oep?f=&url='
.
urlencode
(
z_root
()
.
'/'
.
\
App
::
$cmd
)
.
'" title="oembed" />'
.
"
\r\n
"
;
if
(
$x
=
photos_album_exists
(
$owner_uid
,
$datum
))
{
if
(
$x
=
photos_album_exists
(
$owner_uid
,
get_observer_hash
(),
$datum
))
{
\
App
::
set_pager_itemspage
(
60
);
$album
=
$x
[
'display_path'
];
}
...
...
include/photos.php
View file @
032b6f19
...
...
@@ -582,9 +582,8 @@ function photos_list_photos($channel, $observer, $album = '') {
* @param string $album name of the album
* @return boolean
*/
function
photos_album_exists
(
$channel_id
,
$album
)
{
$sql_extra
=
permissions_sql
(
$channel_id
);
function
photos_album_exists
(
$channel_id
,
$observer_hash
,
$album
)
{
$sql_extra
=
permissions_sql
(
$channel_id
,
$observer_hash
);
$r
=
q
(
"SELECT folder, hash, is_dir, filename, os_path, display_path FROM attach WHERE hash = '%s' AND is_dir = 1 AND uid = %d
$sql_extra
limit 1"
,
dbesc
(
$album
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment