File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -110,14 +110,14 @@ public static function getResponse(): array {
110110 * @throws HttpError
111111 */
112112 public function actionPost ($ data ): object |array |null {
113- $ search = base64_decode ($ data ['searchData ' ]);
113+ $ search = base64_decode ($ data ['searchData ' ], true );
114114 $ isSalted = $ data ['isSalted ' ];
115115 $ separator = $ data ['separator ' ];
116116
117117 if (strlen ($ search ) == 0 ) {
118118 throw new HttpError ("Search query cannot be empty! " );
119119 }
120- else if ($ search === false ) {
120+ else if ($ search === false || mb_check_encoding ( $ search , " UTF-8 " ) == false ) {
121121 throw new HttpError ("Search query is not valid base64! " );
122122 }
123123 else if ($ isSalted && strlen ($ separator ) == 0 ) {
@@ -181,7 +181,12 @@ public function actionPost($data): object|array|null {
181181 for ($ i = 0 ; $ i < sizeof ($ hashes ); $ i ++) {
182182 /** @var $hash Hash */
183183 $ hash = $ joined [Factory::getHashFactory ()->getModelName ()][$ i ];
184- $ matches [] = self ::obj2Resource ($ hash );;
184+ $ hashlist = $ joined [Factory::getHashlistFactory ()->getModelName ()][$ i ];
185+ $ hashResource = self ::obj2Resource ($ hash );
186+ $ hashlistResource = self ::obj2Resource ($ hashlist );
187+ $ hashResource ["attributes " ]["hashlist " ] = $ hashlistResource ["attributes " ];
188+
189+ $ matches [] = $ hashResource ;
185190 }
186191 $ resultEntry ["matches " ] = $ matches ;
187192 }
You can’t perform that action at this time.
0 commit comments