clean up some regex's for i18n, and eliminate old ereg patterns.
This commit is contained in:
parent
7db4a0dd2e
commit
0851669b39
5 changed files with 24 additions and 14 deletions
9
boot.php
9
boot.php
|
@ -736,7 +736,7 @@ function hex2bin($s) {
|
|||
if(! function_exists('paginate')) {
|
||||
function paginate(&$a) {
|
||||
$o = '';
|
||||
$stripped = ereg_replace("(&page=[0-9]*)","",$_SERVER['QUERY_STRING']);
|
||||
$stripped = preg_replace('/(&page=[0-9]*)/','',$_SERVER['QUERY_STRING']);
|
||||
$stripped = str_replace('q=','',$stripped);
|
||||
$stripped = trim($stripped,'/');
|
||||
$url = $a->get_baseurl() . '/' . $stripped;
|
||||
|
@ -1444,3 +1444,10 @@ function search($s) {
|
|||
return $o;
|
||||
}}
|
||||
|
||||
if(! function_exists('valid_email')) {
|
||||
function valid_email($x){
|
||||
if(preg_match('/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$/',$x))
|
||||
return true;
|
||||
return false;
|
||||
}}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue