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

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 97Zeile 97
		if(!trim($mybb->input['regex']))
{
$errors[] = $lang->error_missing_regex;

		if(!trim($mybb->input['regex']))
{
$errors[] = $lang->error_missing_regex;

 
		}

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

if(check_existing_regex($regex))
{
$errors[] = $lang->error_regex_already_available;

		}

if(!trim($mybb->input['replacement']))

		}

if(!trim($mybb->input['replacement']))

Zeile 115Zeile 122
			$new_mycode = array(
'title' => $db->escape_string($mybb->input['title']),
'description' => $db->escape_string($mybb->input['description']),

			$new_mycode = array(
'title' => $db->escape_string($mybb->input['title']),
'description' => $db->escape_string($mybb->input['description']),

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

				'regex' => $db->escape_string($regex),

				'replacement' => $db->escape_string($mybb->input['replacement']),
'active' => $mybb->get_input('active', MyBB::INPUT_INT),
'parseorder' => $mybb->get_input('parseorder', MyBB::INPUT_INT)

				'replacement' => $db->escape_string($mybb->input['replacement']),
'active' => $mybb->get_input('active', MyBB::INPUT_INT),
'parseorder' => $mybb->get_input('parseorder', MyBB::INPUT_INT)

Zeile 224Zeile 231
		if(!trim($mybb->input['regex']))
{
$errors[] = $lang->error_missing_regex;

		if(!trim($mybb->input['regex']))
{
$errors[] = $lang->error_missing_regex;

 
		}

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

if(check_existing_regex($regex))
{
$errors[] = $lang->error_regex_already_available;

		}

if(!trim($mybb->input['replacement']))

		}

if(!trim($mybb->input['replacement']))

Zeile 242Zeile 256
			$updated_mycode = array(
'title' => $db->escape_string($mybb->input['title']),
'description' => $db->escape_string($mybb->input['description']),

			$updated_mycode = array(
'title' => $db->escape_string($mybb->input['title']),
'description' => $db->escape_string($mybb->input['description']),

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

				'regex' => $db->escape_string($regex),

				'replacement' => $db->escape_string($mybb->input['replacement']),
'active' => $mybb->get_input('active', MyBB::INPUT_INT),
'parseorder' => $mybb->get_input('parseorder', MyBB::INPUT_INT)

				'replacement' => $db->escape_string($mybb->input['replacement']),
'active' => $mybb->get_input('active', MyBB::INPUT_INT),
'parseorder' => $mybb->get_input('parseorder', MyBB::INPUT_INT)

Zeile 441Zeile 455
	$array['actual'] = @preg_replace("#".str_replace("\x0", "", $regex)."#si", $replacement, $test);
$array['html'] = htmlspecialchars_uni($array['actual']);
return $array;

	$array['actual'] = @preg_replace("#".str_replace("\x0", "", $regex)."#si", $replacement, $test);
$array['html'] = htmlspecialchars_uni($array['actual']);
return $array;

 
}

/**
* Checks if a regex is already available
*
* @param string $regex
*
* @return bool True if already available, false otherwise
*/
function check_existing_regex($regex='')
{
global $cache;

$mycodes = $cache->read('mycode');
foreach($mycodes as $mycode)
{
if($mycode['regex'] == $regex)
{
return true;
}
}

return false;

}

}