Skip to content

Commit

Permalink
Bug #17723 Patch: Avoid ereg in favor of preg_match
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.php.net/repository/pear/packages/LiveUser/trunk@302732 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
CloCkWeRX committed Aug 24, 2010
1 parent c637ce6 commit 52f6072
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/examples/example4/news_change.php
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/example4/news_new.php
Expand Up @@ -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>');
Expand Down

0 comments on commit 52f6072

Please sign in to comment.