use wp_rand and change hashtags too
This commit is contained in:
parent
ab6aefe446
commit
bf8acf9f51
2 changed files with 3 additions and 3 deletions
|
@ -45,7 +45,7 @@ class Hashtag {
|
||||||
public static function the_content( $the_content ) {
|
public static function the_content( $the_content ) {
|
||||||
$protected_tags = array();
|
$protected_tags = array();
|
||||||
$protect = function( $m ) use ( &$protected_tags ) {
|
$protect = function( $m ) use ( &$protected_tags ) {
|
||||||
$c = count( $protected_tags );
|
$c = \wp_rand( 100000, 999999 );
|
||||||
$protect = '!#!#PROTECT' . $c . '#!#!';
|
$protect = '!#!#PROTECT' . $c . '#!#!';
|
||||||
$protected_tags[ $protect ] = $m[0];
|
$protected_tags[ $protect ] = $m[0];
|
||||||
return $protect;
|
return $protect;
|
||||||
|
|
|
@ -27,10 +27,10 @@ class Mention {
|
||||||
public static function the_content( $the_content ) {
|
public static function the_content( $the_content ) {
|
||||||
$protected_tags = array();
|
$protected_tags = array();
|
||||||
$protect = function( $m ) use ( &$protected_tags ) {
|
$protect = function( $m ) use ( &$protected_tags ) {
|
||||||
$c = \rand( 100000, 999999 );
|
$c = \wp_rand( 100000, 999999 );
|
||||||
$protect = '!#!#PROTECT' . $c . '#!#!';
|
$protect = '!#!#PROTECT' . $c . '#!#!';
|
||||||
while ( isset( $protected_tags[ $protect ] ) ) {
|
while ( isset( $protected_tags[ $protect ] ) ) {
|
||||||
$c = \rand( 100000, 999999 );
|
$c = \wp_rand( 100000, 999999 );
|
||||||
$protect = '!#!#PROTECT' . $c . '#!#!';
|
$protect = '!#!#PROTECT' . $c . '#!#!';
|
||||||
}
|
}
|
||||||
$protected_tags[ $protect ] = $m[0];
|
$protected_tags[ $protect ] = $m[0];
|
||||||
|
|
Loading…
Reference in a new issue