Skip to content

Commit

Permalink
Only escape things that absolutely need it, generate smaller URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdoug committed Jul 9, 2023
1 parent 4b67b2a commit ebbc1e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PackedBox.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public function getVolumeUtilisation(): float
*/
public function generateVisualisationURL(): string
{
return 'https://boxpacker.io/en/master/visualiser.html?packing=' . urlencode(json_encode($this));
return 'https://boxpacker.io/en/master/visualiser.html?packing=' . rawurlencode(json_encode($this, flags: JSON_THROW_ON_ERROR | JSON_NUMERIC_CHECK | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
}

public function __construct(protected Box $box, protected PackedItemList $items)
Expand Down

0 comments on commit ebbc1e9

Please sign in to comment.