Fix: functions "ereg", "ereg_replace", "eregi", "eregi_replace" is deprecated since php 5.3.0
This commit is contained in:
parent
d9438463fe
commit
c8db07011a
@ -52,9 +52,9 @@ function barcode_encode_ean($ean, $encoding = "EAN-13"){
|
|||||||
}
|
}
|
||||||
$encoding=strtoupper($encoding);
|
$encoding=strtoupper($encoding);
|
||||||
if ($encoding=="ISBN"){
|
if ($encoding=="ISBN"){
|
||||||
if (!ereg("^978", $ean)) $ean="978".$ean;
|
if (!preg_match("/^978/", $ean)) $ean="978".$ean;
|
||||||
}
|
}
|
||||||
if (ereg("^978", $ean)) $encoding="ISBN";
|
if (preg_match("/^978/", $ean)) $encoding="ISBN";
|
||||||
if (strlen($ean)<12 || strlen($ean)>13){
|
if (strlen($ean)<12 || strlen($ean)>13){
|
||||||
return array("text"=>"Invalid $encoding Code (must have 12/13 numbers)");
|
return array("text"=>"Invalid $encoding Code (must have 12/13 numbers)");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -134,7 +134,7 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png",
|
|||||||
$width=false;
|
$width=false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ereg("[a-z]", $val)){
|
if (preg_match("/[a-z]/", $val)){
|
||||||
/* tall bar */
|
/* tall bar */
|
||||||
$val=ord($val)-ord('a')+1;
|
$val=ord($val)-ord('a')+1;
|
||||||
}
|
}
|
||||||
@ -184,7 +184,7 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png",
|
|||||||
$width=false;
|
$width=false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ereg("[a-z]", $val)){
|
if (preg_match("/[a-z]/", $val)){
|
||||||
/* tall bar */
|
/* tall bar */
|
||||||
$val=ord($val)-ord('a')+1;
|
$val=ord($val)-ord('a')+1;
|
||||||
$h=$height2;
|
$h=$height2;
|
||||||
@ -253,7 +253,7 @@ function barcode_outtext($code,$bars){
|
|||||||
for ($a=0;$a<$val;$a++) $bar_line.="-";
|
for ($a=0;$a<$val;$a++) $bar_line.="-";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ereg("[a-z]", $val)){
|
if (preg_match("/[a-z]/", $val)){
|
||||||
$val=ord($val)-ord('a')+1;
|
$val=ord($val)-ord('a')+1;
|
||||||
$h=$heigh2;
|
$h=$heigh2;
|
||||||
for ($a=0;$a<$val;$a++) $bar_line.="I";
|
for ($a=0;$a<$val;$a++) $bar_line.="I";
|
||||||
@ -312,7 +312,7 @@ function barcode_outhtml($code, $bars, $scale = 1, $total_y = 0, $space = ''){
|
|||||||
$width=false;
|
$width=false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ereg("[a-z]", $val)){
|
if (preg_match("/[a-z]/", $val)){
|
||||||
//hoher strich
|
//hoher strich
|
||||||
$val=ord($val)-ord('a')+1;
|
$val=ord($val)-ord('a')+1;
|
||||||
$h=$height2;
|
$h=$height2;
|
||||||
@ -395,16 +395,16 @@ function barcode_encode_genbarcode($code,$encoding){
|
|||||||
function barcode_encode($code,$encoding){
|
function barcode_encode($code,$encoding){
|
||||||
global $genbarcode_loc;
|
global $genbarcode_loc;
|
||||||
if (
|
if (
|
||||||
((eregi("^ean$", $encoding)
|
((preg_match("/^ean$/i", $encoding)
|
||||||
&& ( strlen($code)==12 || strlen($code)==13)))
|
&& ( strlen($code)==12 || strlen($code)==13)))
|
||||||
|
|
||||||
|| (($encoding) && (eregi("^isbn$", $encoding))
|
|| (($encoding) && (eregi("^isbn$", $encoding))
|
||||||
&& (( strlen($code)==9 || strlen($code)==10) ||
|
&& (( strlen($code)==9 || strlen($code)==10) ||
|
||||||
(((ereg("^978", $code) && strlen($code)==12) ||
|
(((preg_match("/^978/", $code) && strlen($code)==12) ||
|
||||||
(strlen($code)==13)))))
|
(strlen($code)==13)))))
|
||||||
|
|
||||||
|| (( !isset($encoding) || !$encoding || (eregi("^ANY$", $encoding) ))
|
|| (( !isset($encoding) || !$encoding || (eregi("^ANY$", $encoding) ))
|
||||||
&& (ereg("^[0-9]{12,13}$", $code)))
|
&& (preg_match("/^[0-9]{12,13}$/", $code)))
|
||||||
|
|
||||||
){
|
){
|
||||||
/* use built-in EAN-Encoder */
|
/* use built-in EAN-Encoder */
|
||||||
|
|||||||
@ -69,7 +69,7 @@ class box_external_rss extends ModeleBoxes {
|
|||||||
$this->max=$max;
|
$this->max=$max;
|
||||||
|
|
||||||
// On recupere numero de param de la boite
|
// On recupere numero de param de la boite
|
||||||
ereg('^([0-9]+) ',$this->param,$reg);
|
preg_match('/^([0-9]+) /',$this->param,$reg);
|
||||||
$site=$reg[1];
|
$site=$reg[1];
|
||||||
|
|
||||||
// Creation rep (pas besoin, on le cree apres recup flux)
|
// Creation rep (pas besoin, on le cree apres recup flux)
|
||||||
|
|||||||
@ -493,7 +493,7 @@ function getdnsattributes ($l,$ip){
|
|||||||
$r->nameservers = array("ws1.maxmind.com");
|
$r->nameservers = array("ws1.maxmind.com");
|
||||||
$p = $r->search($l."." . $ip .".s.maxmind.com","TXT","IN");
|
$p = $r->search($l."." . $ip .".s.maxmind.com","TXT","IN");
|
||||||
$str = is_object($p->answer[0])?$p->answer[0]->string():'';
|
$str = is_object($p->answer[0])?$p->answer[0]->string():'';
|
||||||
ereg("\"(.*)\"",$str,$regs);
|
preg_match("/\"(.*)\"/",$str,$regs);
|
||||||
$str = $regs[1];
|
$str = $regs[1];
|
||||||
return $str;
|
return $str;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -292,7 +292,8 @@ class MenuTop {
|
|||||||
if (! empty($conf->telephonie->enabled) && $user->rights->telephonie->lire)
|
if (! empty($conf->telephonie->enabled) && $user->rights->telephonie->lire)
|
||||||
{
|
{
|
||||||
$class="";
|
$class="";
|
||||||
if (ereg("^".DOL_URL_ROOT."\/telephonie\/",$_SERVER["PHP_SELF"]))
|
$pattern = str_replace('/','\/',DOL_URL_ROOT); // Add backslashes for regular expression
|
||||||
|
if (preg_match("/^".$pattern."\/telephonie\//",$_SERVER["PHP_SELF"]))
|
||||||
{
|
{
|
||||||
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||||
}
|
}
|
||||||
@ -312,7 +313,8 @@ class MenuTop {
|
|||||||
{
|
{
|
||||||
$langs->load("energy");
|
$langs->load("energy");
|
||||||
$class="";
|
$class="";
|
||||||
if (ereg("^".DOL_URL_ROOT."\/energie\/",$_SERVER["PHP_SELF"]))
|
$pattern = str_replace('/','\/',DOL_URL_ROOT); // Add backslashes for regular expression
|
||||||
|
if (preg_match("/^".$pattern."\/energie\//",$_SERVER["PHP_SELF"]))
|
||||||
{
|
{
|
||||||
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -292,7 +292,8 @@ class MenuTop {
|
|||||||
if (! empty($conf->telephonie->enabled) && $user->rights->telephonie->lire)
|
if (! empty($conf->telephonie->enabled) && $user->rights->telephonie->lire)
|
||||||
{
|
{
|
||||||
$class="";
|
$class="";
|
||||||
if (ereg("^".DOL_URL_ROOT."\/telephonie\/",$_SERVER["PHP_SELF"]))
|
$pattern = str_replace('/','\/',DOL_URL_ROOT); // Add backslashes for regular expression
|
||||||
|
if (preg_match("/^".$pattern."\/telephonie\//",$_SERVER["PHP_SELF"]))
|
||||||
{
|
{
|
||||||
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||||
}
|
}
|
||||||
@ -312,7 +313,8 @@ class MenuTop {
|
|||||||
{
|
{
|
||||||
$langs->load("energy");
|
$langs->load("energy");
|
||||||
$class="";
|
$class="";
|
||||||
if (ereg("^".DOL_URL_ROOT."\/energie\/",$_SERVER["PHP_SELF"]))
|
$pattern = str_replace('/','\/',DOL_URL_ROOT); // Add backslashes for regular expression
|
||||||
|
if (preg_match("/^".$pattern."\/energie\//",$_SERVER["PHP_SELF"]))
|
||||||
{
|
{
|
||||||
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -249,7 +249,8 @@ class MenuTop {
|
|||||||
if ($conf->telephonie->enabled && $user->rights->telephonie->lire)
|
if ($conf->telephonie->enabled && $user->rights->telephonie->lire)
|
||||||
{
|
{
|
||||||
$class="";
|
$class="";
|
||||||
if (ereg("^".DOL_URL_ROOT."\/telephonie\/",$_SERVER["PHP_SELF"]))
|
$pattern = str_replace('/','\/',DOL_URL_ROOT); // Add backslashes for regular expression
|
||||||
|
if (preg_match("/^".$pattern."\/telephonie\//",$_SERVER["PHP_SELF"]))
|
||||||
{
|
{
|
||||||
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||||
}
|
}
|
||||||
@ -267,7 +268,8 @@ class MenuTop {
|
|||||||
{
|
{
|
||||||
$langs->load("energy");
|
$langs->load("energy");
|
||||||
$class="";
|
$class="";
|
||||||
if (ereg("^".DOL_URL_ROOT."\/energie\/",$_SERVER["PHP_SELF"]))
|
$pattern = str_replace('/','\/',DOL_URL_ROOT); // Add backslashes for regular expression
|
||||||
|
if (preg_match("/^".$pattern."\/energie\//",$_SERVER["PHP_SELF"]))
|
||||||
{
|
{
|
||||||
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
$class='class="tmenusel"'; $_SESSION['idmenu']='';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user