diff --git a/includes/class-hashtag.php b/includes/class-hashtag.php index ca855ef..4f5b0f6 100644 --- a/includes/class-hashtag.php +++ b/includes/class-hashtag.php @@ -45,7 +45,7 @@ class Hashtag { public static function the_content( $the_content ) { $protected_tags = array(); $protect = function( $m ) use ( &$protected_tags ) { - $c = count( $protected_tags ); + $c = \wp_rand( 100000, 999999 ); $protect = '!#!#PROTECT' . $c . '#!#!'; $protected_tags[ $protect ] = $m[0]; return $protect; diff --git a/includes/class-mention.php b/includes/class-mention.php index 6798833..63508e8 100644 --- a/includes/class-mention.php +++ b/includes/class-mention.php @@ -27,10 +27,10 @@ class Mention { public static function the_content( $the_content ) { $protected_tags = array(); $protect = function( $m ) use ( &$protected_tags ) { - $c = \rand( 100000, 999999 ); + $c = \wp_rand( 100000, 999999 ); $protect = '!#!#PROTECT' . $c . '#!#!'; while ( isset( $protected_tags[ $protect ] ) ) { - $c = \rand( 100000, 999999 ); + $c = \wp_rand( 100000, 999999 ); $protect = '!#!#PROTECT' . $c . '#!#!'; } $protected_tags[ $protect ] = $m[0];