File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
app/code/Magento/User/Block Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ protected function _prepareColumns()
185
185
*/
186
186
public function getGridUrl ()
187
187
{
188
- $ roleId = $ this ->getRequest ()->getParam ('rid ' );
188
+ $ roleId = $ this ->_escaper -> escapeJs ( $ this -> escapeHtml ( $ this -> getRequest ()->getParam ('rid ' )) );
189
189
return $ this ->getUrl ('*/*/editrolegrid ' , ['rid ' => $ roleId ]);
190
190
}
191
191
@@ -202,14 +202,14 @@ public function getUsers($json = false)
202
202
if ($ json ) {
203
203
return $ this ->getJSONString ($ inRoleUser );
204
204
}
205
- return $ this ->helper (\ Magento \ Framework \EscapeHelper::class) ->escapeJs ($ this ->escapeHtml ($ inRoleUser ));
205
+ return $ this ->_escaper ->escapeJs ($ this ->escapeHtml ($ inRoleUser ));
206
206
}
207
207
$ roleId = $ this ->getRoleId ();
208
208
$ users = $ this ->getUsersFormData ();
209
209
if (false === $ users ) {
210
210
$ users = $ this ->_roleFactory ->create ()->setId ($ roleId )->getRoleUsers ();
211
211
}
212
- if (sizeof ($ users ) > 0 ) {
212
+ if (! empty ($ users )) {
213
213
if ($ json ) {
214
214
$ jsonUsers = [];
215
215
foreach ($ users as $ userid ) {
@@ -243,6 +243,7 @@ protected function getUsersFormData()
243
243
* Restore Users Form Data from the registry
244
244
*
245
245
* @return array|bool
246
+ * @SuppressWarnings(PHPMD.DiscouragedFunctionsSniff)
246
247
*/
247
248
protected function restoreUsersFormData ()
248
249
{
Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ public function getSelectedRoles($json = false)
155
155
$ result = json_decode ($ userRoles );
156
156
return $ result ? $ this ->_jsonEncoder ->encode ($ result ) : '{} ' ;
157
157
}
158
- return $ this ->helper (\ Magento \ Framework \EscapeHelper::class) ->escapeJs ($ this ->escapeHtml ($ userRoles ));
158
+ return $ this ->_escaper ->escapeJs ($ this ->escapeHtml ($ userRoles ));
159
159
}
160
160
/* @var $user \Magento\User\Model\User */
161
161
$ user = $ this ->_coreRegistry ->registry ('permissions_user ' );
You can’t perform that action at this time.
0 commit comments