mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Search: Ignore public album filter if "Private" feat is disabled #2570
This needs to be very well tested and discussed, as these changes can lead to private photos being accidentally published. Thank you! Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -52,6 +52,14 @@ type TestForm struct {
|
||||
Merged bool `form:"merged" serialize:"-"`
|
||||
}
|
||||
|
||||
func (f *TestForm) GetQuery() string {
|
||||
return f.Query
|
||||
}
|
||||
|
||||
func (f *TestForm) SetQuery(q string) {
|
||||
f.Query = q
|
||||
}
|
||||
|
||||
func TestSerialize(t *testing.T) {
|
||||
form := TestForm{
|
||||
Query: "foo BAR",
|
||||
@@ -100,3 +108,15 @@ func TestSerialize(t *testing.T) {
|
||||
assert.Equal(t, "", result)
|
||||
})
|
||||
}
|
||||
|
||||
func TestUnserialize(t *testing.T) {
|
||||
form := &TestForm{}
|
||||
|
||||
serialized := "q:\"foo BAR\" name:\"yo/ba:z.JPG\" lat:1.500000 lng:-10.333330 chroma:1 diff:424242 year:2002 before:2019-01-15 private:true"
|
||||
|
||||
if err := Unserialize(form, serialized); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, form.Count)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user