Permalink
Browse files

Bug #17723 Patch: Avoid ereg in favor of preg_match

git-svn-id: http://svn.php.net/repository/pear/packages/LiveUser/trunk@302732 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent c637ce6 commit 52f6072910baa04d644d1d73fe8c216bf2d8a8fe @CloCkWeRX CloCkWeRX committed Aug 24, 2010
Showing with 2 additions and 2 deletions.
  1. +1 −1 docs/examples/example4/news_change.php
  2. +1 −1 docs/examples/example4/news_new.php
@@ -44,7 +44,7 @@
if (!empty($news)) {
- if (!ereg('^[1-9][0-9]?$', $valid_to)) {
+ if (!preg_match('/^[1-9][0-9]?$/', $valid_to)) {
$errorMsg = '<p><span style="color: red;">Only numbers between 1 and 99 are allowed here.</span></p>';
} else {
// Form seems to be correct. Write data into the db.
@@ -22,7 +22,7 @@
// If $news is not empty, we have something to work.
if (!empty($news)) {
- if (!ereg('^[1-9][0-9]?$', $valid_to)) {
+ if (!preg_match('/^[1-9][0-9]?$/', $valid_to)) {
$tpl->setVariable('script_msg', '<p style="color: red;">Only numbers between 1 and 99 are allowed here.</p>');
} elseif (!$LU->checkRightLevel(RIGHT_NEWS_NEW, $LU->getProperty('perm_user_id'), $group)) {
$tpl->setVariable('script_msg', '<p style="color: red;">You don\'t have the right to post news for this group.</p>');

0 comments on commit 52f6072

Please sign in to comment.