Vergleich admin/modules/config/mycode.php - 1.8.11 - 1.8.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 235Zeile 235

$regex = str_replace("\x0", "", $mybb->input['regex']);



$regex = str_replace("\x0", "", $mybb->input['regex']);


		if(check_existing_regex($regex))

		if(check_existing_regex($regex, $mycode))

		{
$errors[] = $lang->error_regex_already_available;
}

		{
$errors[] = $lang->error_regex_already_available;
}

Zeile 460Zeile 460
/**
* Checks if a regex is already available
*

/**
* Checks if a regex is already available
*

 * @param string $regex


 * @param string $regex The regex to check
* @param array $current The currently edited MyCode

 *
* @return bool True if already available, false otherwise
*/

 *
* @return bool True if already available, false otherwise
*/

function check_existing_regex($regex='')

function check_existing_regex($regex='', $current=array())

{
global $cache;

{
global $cache;









if(!empty($current) && $current['regex'] == $regex)
{
return false;
}


	$mycodes = $cache->read('mycode');

	$mycodes = $cache->read('mycode');

 


	foreach($mycodes as $mycode)
{
if($mycode['regex'] == $regex)

	foreach($mycodes as $mycode)
{
if($mycode['regex'] == $regex)