File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Catalog/Controller/Adminhtml/Product/Attribute Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -496,12 +496,17 @@ public function getWord()
496
496
/**
497
497
* Get captcha words
498
498
*
499
- * @return string|null
499
+ * @return string
500
500
*/
501
501
private function getWords ()
502
502
{
503
503
$ sessionData = $ this ->session ->getData ($ this ->getFormIdKey (self ::SESSION_WORD ));
504
- return time () < $ sessionData ['expires ' ] ? $ sessionData ['words ' ] : null ;
504
+ $ words = '' ;
505
+ if (isset ($ sessionData ['expires ' ], $ sessionData ['words ' ]) && time () < $ sessionData ['expires ' ]) {
506
+ $ words = $ sessionData ['words ' ];
507
+ }
508
+
509
+ return $ words ;
505
510
}
506
511
507
512
/**
Original file line number Diff line number Diff line change @@ -194,7 +194,10 @@ public function execute()
194
194
$ attributeCode = $ model && $ model ->getId ()
195
195
? $ model ->getAttributeCode ()
196
196
: $ this ->getRequest ()->getParam ('attribute_code ' );
197
- $ attributeCode = $ attributeCode ?: $ this ->generateCode ($ this ->getRequest ()->getParam ('frontend_label ' )[0 ]);
197
+ if (!$ attributeCode ) {
198
+ $ frontendLabel = $ this ->getRequest ()->getParam ('frontend_label ' )[0 ] ?? '' ;
199
+ $ attributeCode = $ this ->generateCode ($ frontendLabel );
200
+ }
198
201
$ data ['attribute_code ' ] = $ attributeCode ;
199
202
200
203
//validate frontend_input
You can’t perform that action at this time.
0 commit comments