File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -3552,8 +3552,6 @@ public function prepareInputForClone($input)
35523552 $ input ['ranking ' ] = $ nextRanking ;
35533553 $ input ['uuid ' ] = static ::getUuid ();
35543554
3555- $ input = Toolbox::addslashes_deep ($ input );
3556-
35573555 return $ input ;
35583556 }
35593557
Original file line number Diff line number Diff line change @@ -604,6 +604,28 @@ public function testClone()
604604 )
605605 )->isIdenticalTo ($ expected );
606606 }
607+
608+ //rename rule with a quote, then clone
609+ $ rules_id = $ cloned ;
610+ $ rule = new \RuleAsset (); //needed to reset last_clone_index...
611+ $ this ->boolean ($ rule ->update (['id ' => $ rules_id , 'name ' => addslashes ("User's assigned " )]))->isTrue ();
612+ $ this ->boolean ($ rule ->getFromDB ($ rules_id ))->isTrue ();
613+
614+ $ cloned = $ rule ->clone ();
615+ $ this ->integer ($ cloned )->isGreaterThan ($ rules_id );
616+ $ this ->boolean ($ rule ->getFromDB ($ cloned ))->isTrue ();
617+
618+ $ this ->integer ($ rule ->fields ['is_active ' ])->isIdenticalTo (0 );
619+ $ this ->string ($ rule ->fields ['name ' ])->isIdenticalTo ("User's assigned (copy) " );
620+
621+ foreach ($ relations as $ relation => $ expected ) {
622+ $ this ->integer (
623+ countElementsInTable (
624+ $ relation ::getTable (),
625+ ['rules_id ' => $ cloned ]
626+ )
627+ )->isIdenticalTo ($ expected );
628+ }
607629 }
608630
609631 public function testRanking ()
You can’t perform that action at this time.
0 commit comments