Zeile 135 | Zeile 135 |
---|
$cache->update_mycode();
// Log admin action
|
$cache->update_mycode();
// Log admin action
|
log_admin_action($cid, htmlspecialchars_uni($mybb->input['title']));
| log_admin_action($cid, $mybb->input['title']);
|
flash_message($lang->success_added_mycode, 'success'); admin_redirect('index.php?module=config-mycode');
| flash_message($lang->success_added_mycode, 'success'); admin_redirect('index.php?module=config-mycode');
|
Zeile 235 | Zeile 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 269 | Zeile 269 |
---|
$cache->update_mycode();
// Log admin action
|
$cache->update_mycode();
// Log admin action
|
log_admin_action($mycode['cid'], htmlspecialchars_uni($mybb->input['title']));
| log_admin_action($mycode['cid'], $mybb->input['title']);
|
flash_message($lang->success_updated_mycode, 'success'); admin_redirect('index.php?module=config-mycode');
| flash_message($lang->success_updated_mycode, 'success'); admin_redirect('index.php?module=config-mycode');
|
Zeile 368 | Zeile 368 |
---|
$cache->update_mycode();
// Log admin action
|
$cache->update_mycode();
// Log admin action
|
log_admin_action($mycode['cid'], htmlspecialchars_uni($mycode['title']));
| log_admin_action($mycode['cid'], $mycode['title']);
|
flash_message($lang->success_deleted_mycode, 'success'); admin_redirect("index.php?module=config-mycode");
| flash_message($lang->success_deleted_mycode, 'success'); admin_redirect("index.php?module=config-mycode");
|
Zeile 460 | Zeile 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)
|