@@ -58,8 +58,8 @@ public function getPrivateAttachmentsCount(): int
5858 {
5959 $ qb = $ this ->createQueryBuilder ('attachment ' );
6060 $ qb ->select ('COUNT(attachment) ' )
61- ->where ('attachment.path LIKE :like ' );
62- $ qb ->setParameter ('like ' , '\\ %SECURE \\ %% ' );
61+ ->where ('attachment.path LIKE :like ESCAPE \' # \' ' );
62+ $ qb ->setParameter ('like ' , '# %SECURE# %% ' );
6363 $ query = $ qb ->getQuery ();
6464
6565 return (int ) $ query ->getSingleScalarResult ();
@@ -94,12 +94,12 @@ public function getUserUploadedAttachments(): int
9494 {
9595 $ qb = $ this ->createQueryBuilder ('attachment ' );
9696 $ qb ->select ('COUNT(attachment) ' )
97- ->where ('attachment.path LIKE :base ' )
98- ->orWhere ('attachment.path LIKE :media ' )
99- ->orWhere ('attachment.path LIKE :secure ' );
100- $ qb ->setParameter ('secure ' , '\\ %SECURE \\ %% ' );
101- $ qb ->setParameter ('base ' , '\\ %BASE \\ %% ' );
102- $ qb ->setParameter ('media ' , '\\ %MEDIA \\ %% ' );
97+ ->where ('attachment.path LIKE :base ESCAPE \' # \' ' )
98+ ->orWhere ('attachment.path LIKE :media ESCAPE \' # \' ' )
99+ ->orWhere ('attachment.path LIKE :secure ESCAPE \' # \' ' );
100+ $ qb ->setParameter ('secure ' , '# %SECURE# %% ' );
101+ $ qb ->setParameter ('base ' , '# %BASE# %% ' );
102+ $ qb ->setParameter ('media ' , '# %MEDIA# %% ' );
103103 $ query = $ qb ->getQuery ();
104104
105105 return (int ) $ query ->getSingleScalarResult ();
0 commit comments