Skip to content

Commit

Permalink
Improve ID entropy, refs #12 (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwjames authored Feb 10, 2018
1 parent 8ff3613 commit 335dc87
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/MermaidParserFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ public function setDefaultTheme( $defaultTheme ) {
public function parse( array $params ) {

$class = 'ext-mermaid';
$id = 'ext-mermaid-' . uniqid();

// #12 Improve entropy by adding a random number
$id = uniqid( 'ext-mermaid-' . rand( 1, 10000 ) );


if( isset( $params[0] ) && $params[0] instanceof \Parser ) {
array_shift( $params );
Expand Down

0 comments on commit 335dc87

Please sign in to comment.