(http://www.onlinewerbebombe.de)
- Der User profi-concept aus meinem Forum hat mir sehr viele gute Patches zur
Verfuegung gestellt (http://www.stelzi.net)
-- Irgentjemand, den ich noch vergessen habe...
+- Irgent jemand, den ich noch vergessen habe...
Websites / Programmierer / etc.:
- SF.net: Hosten meine Projektdateien (nur Archive)
$this->_item['link'] = trim($this->_item['link']);
if ((!empty($this->_display_opt['refid'])) && (!empty($this->_item['link'])))
{
- if (!ereg('refid=', $this->_item['link'])) $this->_item['link'] .= '?refid=' . $this->_display_opt['refid'];
+ if (!isInString('refid=', $this->_item['link'])) $this->_item['link'] .= '?refid=' . $this->_display_opt['refid'];
}
switch ($name) {
case 'item':
eval("\$subject = decodeEntities(\"".compileRawCode(escapeQuotes($subject))."\");");
// Set from header
- if ((!eregi('@', $toEmail)) && ($toEmail > 0)) {
+ if ((!isInStringIgnoreCase('@', $toEmail)) && ($toEmail > 0)) {
// Value detected, is the message extension installed?
// @TODO Extension 'msg' does not exist
if (isExtensionActive('msg')) {
$OUT .= "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"timebox_table dashed\">\n";
$OUT .= "<tr>\n";
- if (ereg('Y', $display) || (empty($display))) {
+ if (isInString('Y', $display) || (empty($display))) {
$OUT .= " <td align=\"center\" class=\"timebox_column bottom\"><div class=\"tiny\">{--_YEARS--}</strong></td>\n";
}
- if (ereg('M', $display) || (empty($display))) {
+ if (isInString('M', $display) || (empty($display))) {
$OUT .= " <td align=\"center\" class=\"timebox_column bottom\"><div class=\"tiny\">{--_MONTHS--}</strong></td>\n";
}
- if (ereg('W', $display) || (empty($display))) {
+ if (isInString('W', $display) || (empty($display))) {
$OUT .= " <td align=\"center\" class=\"timebox_column bottom\"><div class=\"tiny\">{--_WEEKS--}</strong></td>\n";
}
- if (ereg('D', $display) || (empty($display))) {
+ if (isInString('D', $display) || (empty($display))) {
$OUT .= " <td align=\"center\" class=\"timebox_column bottom\"><div class=\"tiny\">{--_DAYS--}</strong></td>\n";
}
- if (ereg('h', $display) || (empty($display))) {
+ if (isInString('h', $display) || (empty($display))) {
$OUT .= " <td align=\"center\" class=\"timebox_column bottom\"><div class=\"tiny\">{--_HOURS--}</strong></td>\n";
}
- if (ereg('m', $display) || (empty($display))) {
+ if (isInString('m', $display) || (empty($display))) {
$OUT .= " <td align=\"center\" class=\"timebox_column bottom\"><div class=\"tiny\">{--_MINUTES--}</strong></td>\n";
}
- if (ereg('s', $display) || (empty($display))) {
+ if (isInString('s', $display) || (empty($display))) {
$OUT .= " <td align=\"center\" class=\"timebox_column bottom\"><div class=\"tiny\">{--_SECONDS--}</strong></td>\n";
}
$OUT .= "</tr>\n";
$OUT .= "<tr>\n";
- if (ereg('Y', $display) || (empty($display))) {
+ if (isInString('Y', $display) || (empty($display))) {
// Generate year selection
$OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_ye\" size=\"1\">\n";
for ($idx = '0'; $idx <= 10; $idx++) {
$OUT .= '<input type="hidden" name="' . $prefix . '_ye" value="0" />';
}
- if (ereg('M', $display) || (empty($display))) {
+ if (isInString('M', $display) || (empty($display))) {
// Generate month selection
$OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_mo\" size=\"1\">\n";
for ($idx = '0'; $idx <= 11; $idx++)
$OUT .= '<input type="hidden" name="' . $prefix . '_mo" value="0" />';
}
- if (ereg('W', $display) || (empty($display))) {
+ if (isInString('W', $display) || (empty($display))) {
// Generate week selection
$OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_we\" size=\"1\">\n";
for ($idx = '0'; $idx <= 4; $idx++) {
$OUT .= '<input type="hidden" name="' . $prefix . '_we" value="0" />';
}
- if (ereg('D', $display) || (empty($display))) {
+ if (isInString('D', $display) || (empty($display))) {
// Generate day selection
$OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_da\" size=\"1\">\n";
for ($idx = '0'; $idx <= 31; $idx++) {
$OUT .= '<input type="hidden" name="' . $prefix . '_da" value="0" />';
}
- if (ereg('h', $display) || (empty($display))) {
+ if (isInString('h', $display) || (empty($display))) {
// Generate hour selection
$OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_ho\" size=\"1\">\n";
for ($idx = '0'; $idx <= 23; $idx++) {
$OUT .= '<input type="hidden" name="' . $prefix . '_ho" value="0" />';
}
- if (ereg('m', $display) || (empty($display))) {
+ if (isInString('m', $display) || (empty($display))) {
// Generate minute selection
$OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_mi\" size=\"1\">\n";
for ($idx = '0'; $idx <= 59; $idx++) {
$OUT .= '<input type="hidden" name="' . $prefix . '_mi" value="0" />';
}
- if (ereg('s', $display) || (empty($display))) {
+ if (isInString('s', $display) || (empty($display))) {
// Generate second selection
$OUT .= " <td align=\"center\"><select class=\"mini_select\" name=\"" . $prefix . "_se\" size=\"1\">\n";
for ($idx = '0'; $idx <= 59; $idx++) {
// Extract host name
$host = str_replace('http://', '', $url);
- if (ereg('/', $host)) $host = substr($host, 0, strpos($host, '/'));
+ if (isInString('/', $host)) $host = substr($host, 0, strpos($host, '/'));
// Generate relative URL
//* DEBUG: */ print("SCRIPT=" . $script.'<br />');
} // END - if
// Was the request successfull?
- if ((!eregi('200 OK', $response[0])) || (empty($response[0]))) {
+ if ((!isInStringIgnoreCase('200 OK', $response[0])) || (empty($response[0]))) {
// Not found / access forbidden
$response = array('', '', '');
} // END - if
return $response;
}
-// Taken from www.php.net eregi() user comments
+// Taken from www.php.net isInStringIgnoreCase() user comments
function isEmailValid ($email) {
// Check first part of email address
$first = '[-a-z0-9!#$%&\'*+/=?^_<{|}~]+(\.[-a-zA-Z0-9!#$%&\'*+/=?^_<{|}~]+)*';
return preg_match($regex, $email);
}
-// Function taken from user comments on www.php.net / function eregi()
+// Function taken from user comments on www.php.net / function isInStringIgnoreCase()
function isUrlValid ($URL, $compile=true) {
// Trim URL a little
$URL = trim(urldecode($URL));
return $code;
}
-// Function taken from user comments on www.php.net / function eregi()
+// Function taken from user comments on www.php.net / function isInStringIgnoreCase()
function isUrlValidSimple ($url) {
// Prepare URL
$url = secureString(str_replace("\\", '', compileRawCode(urldecode($url))));
'PLEASE_CLICK_NICKNAME_FORM' => "Hier können Sie sich nun einen einrichten...",
'NICKNAME_ADMIN_CONFIG_HEADER' => "Einstellungen am Nicknamen",
'ADMIN_NICKNAME_MIN_LENGTH' => "Minimale Länge",
- 'ADMIN_NICKNAME_PATTERN' => "Pattern für ereg()-Befehl",
+ 'ADMIN_NICKNAME_PATTERN' => "Pattern für isInString()-Befehl",
'ADMIN_NICKNAME_LANG_CHARS' => "Zeichenfolge für Sprachdatei",
));
//
function checkHtmlTags ($html) {
$test = stripslashes($html);
- while (ereg('<', $test) && ereg('>', $test)) {
+ while (isInString('<', $test) && isInString('>', $test)) {
$check = strtolower(substr($test, strpos($test, '<') + 1, strpos($test, '>') - strpos($test, '<') - 1));
$check = str_replace('/', '', $check);
if (!in_array($check, $GLOBALS['html_tags'])) {
$test = $text;
// First replace URLs...
- while (ereg('http://', $test)) {
+ while (isInString('http://', $test)) {
$check = substr($test, strpos($test, 'http://')); $check2 = $check;
// See ext-html.php if you want to add more URL ends...
foreach ($GLOBALS['url_ends'] as $end) {
- if (ereg($end, $check)) $check = substr($check, 0, strpos($check, $end));
+ if (isInString($end, $check)) $check = substr($check, 0, strpos($check, $end));
} // END - foreach
// Now replace the URL against anchor container and pray...
// ... what will the email address be out the @... ;-)
$PARTS = array();
- while (ereg('@', $test)) {
+ while (isInString('@', $test)) {
$pos = strpos($test, '@');
$test2 = substr($test, 0, $pos);
$test = $text;
// First replace URLs...
- while (ereg('http://', $test)) {
+ while (isInString('http://', $test)) {
$check = substr($test, strpos($test, 'http://')); $check2 = $check;
// See ext-html.php if you want to add more URL ends...
foreach ($GLOBALS['url_ends'] as $end) {
- if (ereg($end, $check)) $check = substr($check, 0, strpos($check, $end));
+ if (isInString($end, $check)) $check = substr($check, 0, strpos($check, $end));
} // END - foreach
// Now replace the URL against anchor container and pray...
// ... what will the email address be out the @... ;-)
$PARTS = array();
- while (ereg('@', $test)) {
+ while (isInString('@', $test)) {
$pos = strpos($test, '@');
$test2 = substr($test, 0, $pos);
// Rewrite links in HTML for better SEO (ugly part of mx!)
function rewriteLinksInCode ($HTML) {
// Skip rewriting for configured modules
- if (eregi(getModule(), getConfig('rewrite_skip')) !== false) return $HTML;
+ if (isInStringIgnoreCase(getModule(), getConfig('rewrite_skip')) !== false) return $HTML;
// Generate target URL
$target = '{?URL?}/cms/';
} // END - foreach
// Do we have an URL linked to mxchange.org?
- if (eregi(getConfig('SERVER_URL'), $output)) {
+ if (isInStringIgnoreCase(getConfig('SERVER_URL'), $output)) {
// Convert URLs from my server
$output = str_replace('{?URL?}/modules.php?module=', getConfig('SERVER_URL') . '/cms/', $output);
$phpSelfFile = basename($_SERVER['PHP_SELF']);
// Check for a .php inside the $phpSelfDirectory...
- while (ereg('.php', $phpSelfDirectory)) {
+ while (strpos($phpSelfDirectory, '.php') !== false) {
// Correct the dirname
$phpSelfDirectory = substr($phpSelfDirectory, 0, (strpos($phpSelfDirectory, '.php') + 4));
// Rewrite filename...
if (empty($content['title'])) $content['title'] = '---';
// Already registered module?
- if (ereg($content['module'], getConfig('rewrite_skip'))) {
+ if (isInString($content['module'], getConfig('rewrite_skip'))) {
// Found
$y = ' checked="checked"';
$n = '';
$response = array('', '', '');
} else {
// Analyse header for response code
- if (eregi('200 OK', $response[0])) {
+ if (isInStringIgnoreCase('200 OK', $response[0])) {
// Found, kill header
$pos = '0';
foreach($response as $k => $v) {
if (isPostRequestParameterSet('nickname')) {
// Check if nickname is valid
$PATTERN = '[' . getConfig('nickname_pattern') . ']{' . getConfig('nickname_len') . ',}';
- if (ereg($PATTERN, postRequestParameter('nickname'), $array)) {
+ if (isInString($PATTERN, postRequestParameter('nickname'), $array)) {
// Entered nickname is valid?
$isValid = ($array[0] == postRequestParameter('nickname'));
} // END - if
/* Retry while there is no connection */
while($index < count($hosts) && $connection == false) {
$hostinfo = array();
- if(eregi('^(.+):([0-9]+)$', $hosts[$index], $hostinfo)) {
+ if(isInStringIgnoreCase('^(.+):([0-9]+)$', $hosts[$index], $hostinfo)) {
$host = $hostinfo[1];
$port = $hostinfo[2];
} else {
array(bigintval($DATA['id'])), __FILE__, __LINE__);
// "Explode" all receivers into an array
- if (ereg(';', $DATA['receivers'])) {
+ if (isInString(';', $DATA['receivers'])) {
// There's more than one receiver in the list...
$receiverS = explode(';', $DATA['receivers']);
} elseif (!empty($DATA['points'])) {
// Entry updated?
if (SQL_AFFECTEDROWS() == 1) {
// "Explode" all receivers into an array
- if (ereg(';', $DATA['receivers'])) {
+ if (isInString(';', $DATA['receivers'])) {
// There's more than one receiver in the list...
$receiverS = explode(';', $DATA['receivers']);
} elseif (!empty($DATA['receivers'])) {
return $data;
}
+// Wrapper for strpos() to ease porting from deprecated ereg() function
+function isInString ($needle, $haystack) {
+ return (strpos($haystack, $needle) !== false);
+}
+
+// Wrapper for strpos() to ease porting from deprecated eregi() function
+// This function is case-insensitive
+function isInStringIgnoreCase ($needle, $haystack) {
+ return (isInString(strtolower($haystack), strtolower($needle)));
+}
+
// [EOF]
?>