Fix item description with emoji

This commit is contained in:
Alex P 2022-05-13 17:09:58 +03:00
parent c3887bec7a
commit a8c1f386aa
2 changed files with 2 additions and 2 deletions

View file

@ -142,7 +142,7 @@ class ItemFactory {
mb_substr( $product->get_name(), 0, 127 ),
new Money( $price_without_tax_rounded, $currency ),
$quantity,
mb_substr( wp_strip_all_tags( $product->get_description() ), 0, 127 ),
substr( wp_strip_all_tags( $product->get_description() ), 0, 127 ) ?: '',
$tax,
$product->get_sku(),
( $product->is_virtual() ) ? Item::DIGITAL_GOODS : Item::PHYSICAL_GOODS

View file

@ -300,7 +300,7 @@ class ItemFactoryTest extends TestCase
* @var Item $item
*/
$this->assertEquals(mb_substr($name, 0, 127), $item->name());
$this->assertEquals(mb_substr($description, 0, 127), $item->description());
$this->assertEquals(substr($description, 0, 127), $item->description());
}
public function testFromPayPalResponse()