mirror of
https://github.com/vrana/adminer.git
synced 2025-08-07 23:27:17 +02:00
Replace ereg*() by preg_*()
ereg() triggers deprecated error which is sent to custom error handlers. It is also faster. There are no more deprecated functions except mysql_connect().
This commit is contained in:
@@ -10,14 +10,14 @@
|
||||
class AdminerTinymce {
|
||||
/** @access protected */
|
||||
var $path;
|
||||
|
||||
|
||||
/**
|
||||
* @param string
|
||||
*/
|
||||
function AdminerTinymce($path = "tiny_mce/tiny_mce.js") {
|
||||
$this->path = $path;
|
||||
}
|
||||
|
||||
|
||||
function head() {
|
||||
$lang = "en";
|
||||
if (function_exists('get_lang')) { // since Adminer 3.2.0
|
||||
@@ -45,9 +45,9 @@ tinyMCE.init({
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
function selectVal(&$val, $link, $field) {
|
||||
if (ereg("_html", $field["field"]) && $val != ' ') {
|
||||
if (preg_match("~_html~", $field["field"]) && $val != ' ') {
|
||||
$shortened = (substr($val, -10) == "<i>...</i>");
|
||||
if ($shortened) {
|
||||
$val = substr($val, 0, -10);
|
||||
@@ -65,9 +65,9 @@ tinyMCE.init({
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function editInput($table, $field, $attrs, $value) {
|
||||
if (ereg("text", $field["type"]) && ereg("_html", $field["field"])) {
|
||||
if (preg_match("~text~", $field["type"]) && preg_match("~_html~", $field["field"])) {
|
||||
return "<textarea$attrs id='fields-" . h($field["field"]) . "' rows='12' cols='50'>" . h($value) . "</textarea><script type='text/javascript'>
|
||||
tinyMCE.remove(tinyMCE.get('fields-" . js_escape($field["field"]) . "') || { });
|
||||
tinyMCE.execCommand('mceAddControl', true, 'fields-" . js_escape($field["field"]) . "');
|
||||
@@ -79,5 +79,5 @@ document.getElementById('form').onsubmit = function () {
|
||||
</script>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user