mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 09:38:23 +01:00
Fix: functions "ereg", "ereg_replace", "eregi", "eregi_replace" is deprecated since php 5.3.0
This commit is contained in:
@@ -171,7 +171,7 @@ function MakeFontDescriptor($fm,$symbolic)
|
|||||||
//StemV
|
//StemV
|
||||||
if(isset($fm['StdVW']))
|
if(isset($fm['StdVW']))
|
||||||
$stemv=$fm['StdVW'];
|
$stemv=$fm['StdVW'];
|
||||||
elseif(isset($fm['Weight']) and eregi('(bold|black)',$fm['Weight']))
|
elseif(isset($fm['Weight']) and preg_match('/(bold|black)/i',$fm['Weight']))
|
||||||
$stemv=120;
|
$stemv=120;
|
||||||
else
|
else
|
||||||
$stemv=70;
|
$stemv=70;
|
||||||
|
|||||||
@@ -102,8 +102,8 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
$property[$i]['istime']=false;
|
$property[$i]['istime']=false;
|
||||||
}
|
}
|
||||||
if (eregi('varchar',$property[$i]['type'])
|
if (preg_match('/varchar/i',$property[$i]['type'])
|
||||||
|| eregi('text',$property[$i]['type']))
|
|| preg_match('/text/i',$property[$i]['type']))
|
||||||
{
|
{
|
||||||
$property[$i]['ischar']=true;
|
$property[$i]['ischar']=true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ FILE_SKIP_EMPTY_LINES);
|
|||||||
private function getTranslationFilesArray($lang){
|
private function getTranslationFilesArray($lang){
|
||||||
$dir = new DirectoryIterator($this->langDir.$lang);
|
$dir = new DirectoryIterator($this->langDir.$lang);
|
||||||
while($dir->valid()) {
|
while($dir->valid()) {
|
||||||
if(!$dir->isDot() && $dir->isFile() && ! eregi('^\.',$dir->getFilename())) {
|
if(!$dir->isDot() && $dir->isFile() && ! preg_match('/^\./',$dir->getFilename())) {
|
||||||
$files[] = $dir->getFilename();
|
$files[] = $dir->getFilename();
|
||||||
}
|
}
|
||||||
$dir->next();
|
$dir->next();
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ print "</div>\n";
|
|||||||
|
|
||||||
if ($errmsg)
|
if ($errmsg)
|
||||||
{
|
{
|
||||||
if (eregi('^Error',$errmsg))
|
if (preg_match('/^Error/i',$errmsg))
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$errmsg=$langs->trans($errmsg);
|
$errmsg=$langs->trans($errmsg);
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ foreach ($conf->file->dol_document_root as $dirroot)
|
|||||||
{
|
{
|
||||||
if (is_readable($dir.$file))
|
if (is_readable($dir.$file))
|
||||||
{
|
{
|
||||||
if (eregi('(.*)\.modules\.php$',$file,$reg))
|
if (preg_match('/(.*)\.modules\.php$/i',$file,$reg))
|
||||||
{
|
{
|
||||||
$filebis=$reg[1];
|
$filebis=$reg[1];
|
||||||
|
|
||||||
|
|||||||
@@ -194,13 +194,13 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
if (strlen($record['box_order']) == 1)
|
if (strlen($record['box_order']) == 1)
|
||||||
{
|
{
|
||||||
if (eregi("[13579]{1}",substr($record['box_order'],-1)))
|
if (preg_match("/[13579]{1}/",substr($record['box_order'],-1)))
|
||||||
{
|
{
|
||||||
$box_order = "A0".$record['box_order'];
|
$box_order = "A0".$record['box_order'];
|
||||||
$sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order'];
|
$sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order'];
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
}
|
}
|
||||||
else if (eregi("[02468]{1}",substr($record['box_order'],-1)))
|
else if (preg_match("/[02468]{1}/",substr($record['box_order'],-1)))
|
||||||
{
|
{
|
||||||
$box_order = "B0".$record['box_order'];
|
$box_order = "B0".$record['box_order'];
|
||||||
$sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order'];
|
$sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order'];
|
||||||
@@ -209,13 +209,13 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
else if (strlen($record['box_order']) == 2)
|
else if (strlen($record['box_order']) == 2)
|
||||||
{
|
{
|
||||||
if (eregi("[13579]{1}",substr($record['box_order'],-1)))
|
if (preg_match("/[13579]{1}/",substr($record['box_order'],-1)))
|
||||||
{
|
{
|
||||||
$box_order = "A".$record['box_order'];
|
$box_order = "A".$record['box_order'];
|
||||||
$sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order'];
|
$sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order'];
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
}
|
}
|
||||||
else if (eregi("[02468]{1}",substr($record['box_order'],-1)))
|
else if (preg_match("/[02468]{1}/",substr($record['box_order'],-1)))
|
||||||
{
|
{
|
||||||
$box_order = "B".$record['box_order'];
|
$box_order = "B".$record['box_order'];
|
||||||
$sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order'];
|
$sql="update llx_boxes set box_order = '".$box_order."' where box_order = ".$record['box_order'];
|
||||||
|
|||||||
@@ -329,7 +329,7 @@ $handle=opendir($dir);
|
|||||||
$var=true;
|
$var=true;
|
||||||
while (($file = readdir($handle))!==false)
|
while (($file = readdir($handle))!==false)
|
||||||
{
|
{
|
||||||
if (eregi('\.modules\.php$',$file) && substr($file,0,4) == 'pdf_')
|
if (preg_match('/\.modules\.php$/i',$file) && substr($file,0,4) == 'pdf_')
|
||||||
{
|
{
|
||||||
$name = substr($file, 4, strlen($file) -16);
|
$name = substr($file, 4, strlen($file) -16);
|
||||||
$classname = substr($file, 0, strlen($file) -12);
|
$classname = substr($file, 0, strlen($file) -12);
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ if ( (isset($_POST["action"]) && $_POST["action"] == 'update')
|
|||||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD",$_POST["gencod"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD",$_POST["gencod"],'chaine',0,'',$conf->entity);
|
||||||
if ($_FILES["logo"]["tmp_name"])
|
if ($_FILES["logo"]["tmp_name"])
|
||||||
{
|
{
|
||||||
if (eregi('([^\\\/:]+)$',$_FILES["logo"]["name"],$reg))
|
if (preg_match('/([^\\/:]+)$/i',$_FILES["logo"]["name"],$reg))
|
||||||
{
|
{
|
||||||
$original_file=$reg[1];
|
$original_file=$reg[1];
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ if ( (isset($_POST["action"]) && $_POST["action"] == 'update')
|
|||||||
$quality = 80;
|
$quality = 80;
|
||||||
|
|
||||||
$imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$original_file, 200, 100, '_small', $quality);
|
$imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$original_file, 200, 100, '_small', $quality);
|
||||||
if (eregi('([^\\\/:]+)$',$imgThumbSmall,$reg))
|
if (preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg))
|
||||||
{
|
{
|
||||||
$imgThumbSmall = $reg[1];
|
$imgThumbSmall = $reg[1];
|
||||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall,'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall,'chaine',0,'',$conf->entity);
|
||||||
@@ -86,7 +86,7 @@ if ( (isset($_POST["action"]) && $_POST["action"] == 'update')
|
|||||||
|
|
||||||
// Creation de la vignette de la page "Societe/Institution"
|
// Creation de la vignette de la page "Societe/Institution"
|
||||||
$imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$original_file, 100, 30, '_mini', $quality);
|
$imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$original_file, 100, 30, '_mini', $quality);
|
||||||
if (eregi('([^\\\/:]+)$',$imgThumbMini,$reg))
|
if (preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg))
|
||||||
{
|
{
|
||||||
$imgThumbMini = $reg[1];
|
$imgThumbMini = $reg[1];
|
||||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini,'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini,'chaine',0,'',$conf->entity);
|
||||||
@@ -137,7 +137,7 @@ if ($_GET["action"] == 'addthumb')
|
|||||||
{
|
{
|
||||||
// Creation de la vignette de la page login
|
// Creation de la vignette de la page login
|
||||||
$imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], 200, 100, '_small',80);
|
$imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], 200, 100, '_small',80);
|
||||||
if (image_format_supported($imgThumbSmall) >= 0 && eregi('([^\\\/:]+)$',$imgThumbSmall,$reg))
|
if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg))
|
||||||
{
|
{
|
||||||
$imgThumbSmall = $reg[1];
|
$imgThumbSmall = $reg[1];
|
||||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall,'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall,'chaine',0,'',$conf->entity);
|
||||||
@@ -146,7 +146,7 @@ if ($_GET["action"] == 'addthumb')
|
|||||||
|
|
||||||
// Creation de la vignette de la page "Societe/Institution"
|
// Creation de la vignette de la page "Societe/Institution"
|
||||||
$imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], 100, 30, '_mini',80);
|
$imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], 100, 30, '_mini',80);
|
||||||
if (image_format_supported($imgThumbSmall) >= 0 && eregi('([^\\\/:]+)$',$imgThumbMini,$reg))
|
if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg))
|
||||||
{
|
{
|
||||||
$imgThumbMini = $reg[1];
|
$imgThumbMini = $reg[1];
|
||||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini,'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini,'chaine',0,'',$conf->entity);
|
||||||
@@ -551,7 +551,7 @@ else
|
|||||||
print '</td><td valign="center" align="right">';
|
print '</td><td valign="center" align="right">';
|
||||||
|
|
||||||
// On propose la generation de la vignette si elle n'existe pas
|
// On propose la generation de la vignette si elle n'existe pas
|
||||||
if (!is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini) && eregi('(\.jpg|\.jpeg|\.png)$',$mysoc->logo))
|
if (!is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini) && preg_match('/(\.jpg|\.jpeg|\.png)$/i',$mysoc->logo))
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=addthumb&file='.urlencode($mysoc->logo).'">'.img_refresh($langs->trans('GenerateThumb')).' </a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=addthumb&file='.urlencode($mysoc->logo).'">'.img_refresh($langs->trans('GenerateThumb')).' </a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -670,7 +670,7 @@ if ($_GET["id"])
|
|||||||
print '<td align="center" nowrap="nowrap">';
|
print '<td align="center" nowrap="nowrap">';
|
||||||
// Est-ce une entree du dictionnaire qui peut etre desactivee ?
|
// Est-ce une entree du dictionnaire qui peut etre desactivee ?
|
||||||
$iserasable=1; // Oui par defaut
|
$iserasable=1; // Oui par defaut
|
||||||
if (isset($obj->code) && ($obj->code == '0' || $obj->code == '' || eregi('unknown',$obj->code))) $iserasable=0;
|
if (isset($obj->code) && ($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) $iserasable=0;
|
||||||
if ($obj->type && $obj->type == 'system') $iserasable=0;
|
if ($obj->type && $obj->type == 'system') $iserasable=0;
|
||||||
|
|
||||||
if ($iserasable) {
|
if ($iserasable) {
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ $handle=opendir($dir);
|
|||||||
$var=True;
|
$var=True;
|
||||||
while (($file = readdir($handle))!==false)
|
while (($file = readdir($handle))!==false)
|
||||||
{
|
{
|
||||||
if (eregi('\.modules\.php$',$file))
|
if (preg_match('/\.modules\.php$/i',$file))
|
||||||
{
|
{
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
$name = substr($file, 0, strlen($file) -12);
|
$name = substr($file, 0, strlen($file) -12);
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ $result=$db->query($sql);
|
|||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
eregi('([0-9]+)$',$obj->name,$reg);
|
preg_match('/([0-9]+)$/i',$obj->name,$reg);
|
||||||
if ($reg[1]) $lastexternalrss = $reg[1];
|
if ($reg[1]) $lastexternalrss = $reg[1];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -238,7 +238,7 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
eregi('^([0-9]+)',$obj->note,$reg);
|
preg_match('/^([0-9]+)/i',$obj->note,$reg);
|
||||||
$idrss = $reg[1];
|
$idrss = $reg[1];
|
||||||
//print "x".$idrss;
|
//print "x".$idrss;
|
||||||
|
|
||||||
|
|||||||
@@ -387,7 +387,7 @@ $handle=opendir($dir);
|
|||||||
$var=True;
|
$var=True;
|
||||||
while (($file = readdir($handle))!==false)
|
while (($file = readdir($handle))!==false)
|
||||||
{
|
{
|
||||||
if (eregi('\.modules\.php$',$file) && substr($file,0,4) == 'pdf_')
|
if (preg_match('/\.modules\.php$/i',$file) && substr($file,0,4) == 'pdf_')
|
||||||
{
|
{
|
||||||
$var = !$var;
|
$var = !$var;
|
||||||
$name = substr($file, 4, strlen($file) -16);
|
$name = substr($file, 4, strlen($file) -16);
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ if ($handle)
|
|||||||
|
|
||||||
while (($file = readdir($handle))!==false)
|
while (($file = readdir($handle))!==false)
|
||||||
{
|
{
|
||||||
if (eregi('^(mod_.*)\.php$',$file,$reg))
|
if (preg_match('/^(mod_.*)\.php$/i',$file,$reg))
|
||||||
{
|
{
|
||||||
$file = $reg[1];
|
$file = $reg[1];
|
||||||
$className = substr($file,4);
|
$className = substr($file,4);
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ $handle=opendir($dir);
|
|||||||
$var=true;
|
$var=true;
|
||||||
while (($file = readdir($handle))!==false)
|
while (($file = readdir($handle))!==false)
|
||||||
{
|
{
|
||||||
if (eregi('\.modules\.php$',$file) && substr($file,0,4) == 'pdf_')
|
if (preg_match('/\.modules\.php$/i',$file) && substr($file,0,4) == 'pdf_')
|
||||||
{
|
{
|
||||||
$name = substr($file, 4, strlen($file) -16);
|
$name = substr($file, 4, strlen($file) -16);
|
||||||
$classname = substr($file, 0, strlen($file) -12);
|
$classname = substr($file, 0, strlen($file) -12);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ $result=$db->query($sql);
|
|||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
eregi('([0-9]+)$',$obj->name,$reg);
|
preg_match('/([0-9]+)$/i',$obj->name,$reg);
|
||||||
if ($reg[1]) $lastftpentry = $reg[1];
|
if ($reg[1]) $lastftpentry = $reg[1];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -217,7 +217,7 @@ else
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
eregi('([0-9]+)$',$obj->name,$reg);
|
preg_match('/([0-9]+)$/i',$obj->name,$reg);
|
||||||
$idrss = $reg[0];
|
$idrss = $reg[0];
|
||||||
//print "x".join(',',$reg)."=".$obj->name."=".$idrss;
|
//print "x".join(',',$reg)."=".$obj->name."=".$idrss;
|
||||||
|
|
||||||
|
|||||||
@@ -175,8 +175,8 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'sendhtml')
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$linuxlike=1;
|
$linuxlike=1;
|
||||||
if (eregi('^win',PHP_OS)) $linuxlike=0;
|
if (preg_match('/^win/i',PHP_OS)) $linuxlike=0;
|
||||||
if (eregi('^mac',PHP_OS)) $linuxlike=0;
|
if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0;
|
||||||
|
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_MAIL_SENDMODE)) $conf->global->MAIN_MAIL_SENDMODE='mail';
|
if (empty($conf->global->MAIN_MAIL_SENDMODE)) $conf->global->MAIN_MAIL_SENDMODE='mail';
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ foreach ($orders as $key => $value)
|
|||||||
print ' <td valign="top" width="14" align="center">';
|
print ' <td valign="top" width="14" align="center">';
|
||||||
if (! empty($objMod->picto))
|
if (! empty($objMod->picto))
|
||||||
{
|
{
|
||||||
if (eregi('^/',$objMod->picto)) print img_picto('',$objMod->picto,'',1);
|
if (preg_match('/^\//i',$objMod->picto)) print img_picto('',$objMod->picto,'',1);
|
||||||
else print img_object('',$objMod->picto);
|
else print img_object('',$objMod->picto);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -190,9 +190,9 @@ $handle=opendir($dir);
|
|||||||
$i=1;
|
$i=1;
|
||||||
while (($file = readdir($handle))!==false)
|
while (($file = readdir($handle))!==false)
|
||||||
{
|
{
|
||||||
if (eregi('(modGeneratePass[a-z]+).class.php',$file,$reg))
|
if (preg_match('/(modGeneratePass[a-z]+)\.class\.php/i',$file,$reg))
|
||||||
{
|
{
|
||||||
// Chargement de la classe de num<EFBFBD>rotation
|
// Chargement de la classe de numerotation
|
||||||
$classname = $reg[1];
|
$classname = $reg[1];
|
||||||
require_once($dir.'/'.$file);
|
require_once($dir.'/'.$file);
|
||||||
|
|
||||||
@@ -299,7 +299,7 @@ $var=!$var;
|
|||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
print '<td colspan="3">'.$langs->trans("MainDbPasswordFileConfEncrypted").'</td>';
|
print '<td colspan="3">'.$langs->trans("MainDbPasswordFileConfEncrypted").'</td>';
|
||||||
print '<td align="center" width="60">';
|
print '<td align="center" width="60">';
|
||||||
if (eregi('crypted:',$dolibarr_main_db_pass) || ! empty($dolibarr_main_db_encrypted_pass))
|
if (preg_match('/crypted:/i',$dolibarr_main_db_pass) || ! empty($dolibarr_main_db_encrypted_pass))
|
||||||
{
|
{
|
||||||
print img_tick();
|
print img_tick();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ print_fiche_titre($langs->trans("Constraints"),'','setup');
|
|||||||
|
|
||||||
// Define request to get table description
|
// Define request to get table description
|
||||||
$base=0;
|
$base=0;
|
||||||
if (eregi('mysql',$conf->db->type))
|
if (preg_match('/mysql/i',$conf->db->type))
|
||||||
{
|
{
|
||||||
$sql = "SHOW TABLE STATUS";
|
$sql = "SHOW TABLE STATUS";
|
||||||
$base=1;
|
$base=1;
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ print_fiche_titre($langs->trans("Tables")." ".ucfirst($conf->db->type),'','setup
|
|||||||
|
|
||||||
// Define request to get table description
|
// Define request to get table description
|
||||||
$base=0;
|
$base=0;
|
||||||
if (eregi('mysql',$conf->db->type))
|
if (preg_match('/mysql/i',$conf->db->type))
|
||||||
{
|
{
|
||||||
$sql = "SHOW TABLE STATUS";
|
$sql = "SHOW TABLE STATUS";
|
||||||
$base=1;
|
$base=1;
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ else
|
|||||||
|
|
||||||
// arraytest is an array of test to do
|
// arraytest is an array of test to do
|
||||||
$arraytest=array();
|
$arraytest=array();
|
||||||
if (eregi('mysql',$db->type))
|
if (preg_match('/mysql/i',$db->type))
|
||||||
{
|
{
|
||||||
$arraytest=array(
|
$arraytest=array(
|
||||||
// "character_set_connection"=>'UTF-8',
|
// "character_set_connection"=>'UTF-8',
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ print_fiche_titre($langs->trans("Table") . " ".$_GET["table"],'','setup');
|
|||||||
|
|
||||||
// Define request to get table description
|
// Define request to get table description
|
||||||
$base=0;
|
$base=0;
|
||||||
if (eregi('mysql',$conf->db->type))
|
if (preg_match('/mysql/i',$conf->db->type))
|
||||||
{
|
{
|
||||||
$sql = "SHOW TABLE STATUS LIKE '".$_GET["table"]."'";
|
$sql = "SHOW TABLE STATUS LIKE '".$_GET["table"]."'";
|
||||||
$base=1;
|
$base=1;
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ foreach($sortorder as $numero=>$name)
|
|||||||
$alt=$name.' - '.$modules_files[$numero];
|
$alt=$name.' - '.$modules_files[$numero];
|
||||||
if (! empty($picto[$numero]))
|
if (! empty($picto[$numero]))
|
||||||
{
|
{
|
||||||
if (eregi('^/',$picto[$numero])) print img_picto($alt,$picto[$numero],'',1);
|
if (preg_match('/^\//',$picto[$numero])) print img_picto($alt,$picto[$numero],'',1);
|
||||||
else print img_object($alt,$picto[$numero]);
|
else print img_object($alt,$picto[$numero]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -42,15 +42,15 @@ print '<table class="noborder" width="100%">';
|
|||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
// R<EFBFBD>cup<EFBFBD>re l'OS au sens PHP
|
// Recupere l'OS au sens PHP
|
||||||
print "<tr $bc[0]><td width=\"240\">".$langs->trans("PHP_OS")."</td><td>".PHP_OS."</td></tr>\n";
|
print "<tr $bc[0]><td width=\"240\">".$langs->trans("PHP_OS")."</td><td>".PHP_OS."</td></tr>\n";
|
||||||
|
|
||||||
// R<EFBFBD>cup<EFBFBD>re la version de l'OS
|
// Recupere la version de l'OS
|
||||||
ob_start();
|
ob_start();
|
||||||
phpinfo();
|
phpinfo();
|
||||||
$chaine = ob_get_contents();
|
$chaine = ob_get_contents();
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
eregi('System </td><td class="v">([^\/]*)</td>',$chaine,$reg);
|
preg_match('/System <\/td><td class="v">([^\\/]*)<\/td>/i',$chaine,$reg);
|
||||||
print "<tr $bc[1]><td width=\"240\">".$langs->trans("Version")."</td><td>".$reg[1]."</td></tr>\n";
|
print "<tr $bc[1]><td width=\"240\">".$langs->trans("Version")."</td><td>".$reg[1]."</td></tr>\n";
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ print '<br>';
|
|||||||
<?php
|
<?php
|
||||||
// Parameteres execution
|
// Parameteres execution
|
||||||
$command='mysql';
|
$command='mysql';
|
||||||
if (eregi(" ",$command)) $command=$command=escapeshellarg($command); // Use quotes on command
|
if (preg_match("/\s/",$command)) $command=$command=escapeshellarg($command); // Use quotes on command
|
||||||
|
|
||||||
$param=$dolibarr_main_db_name;
|
$param=$dolibarr_main_db_name;
|
||||||
$param.=" -h ".$dolibarr_main_db_host;
|
$param.=" -h ".$dolibarr_main_db_host;
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ if ($what == 'mysql')
|
|||||||
|
|
||||||
// Parameteres execution
|
// Parameteres execution
|
||||||
$command=$mysqldump;
|
$command=$mysqldump;
|
||||||
if (eregi(" ",$command)) $command=$command=escapeshellarg($command); // Use quotes on command
|
if (preg_match("/\s/",$command)) $command=$command=escapeshellarg($command); // Use quotes on command
|
||||||
|
|
||||||
//$param=escapeshellarg($dolibarr_main_db_name)." -h ".escapeshellarg($dolibarr_main_db_host)." -u ".escapeshellarg($dolibarr_main_db_user)." -p".escapeshellarg($dolibarr_main_db_pass);
|
//$param=escapeshellarg($dolibarr_main_db_name)." -h ".escapeshellarg($dolibarr_main_db_host)." -u ".escapeshellarg($dolibarr_main_db_user)." -p".escapeshellarg($dolibarr_main_db_pass);
|
||||||
$param=$dolibarr_main_db_name." -h ".$dolibarr_main_db_host;
|
$param=$dolibarr_main_db_name." -h ".$dolibarr_main_db_host;
|
||||||
@@ -188,7 +188,7 @@ if ($what == 'mysql')
|
|||||||
if ($compression == 'none') fclose($handle);
|
if ($compression == 'none') fclose($handle);
|
||||||
if ($compression == 'gz') gzclose($handle);
|
if ($compression == 'gz') gzclose($handle);
|
||||||
if ($compression == 'bz') bzclose($handle);
|
if ($compression == 'bz') bzclose($handle);
|
||||||
if (eregi('^-- MySql',$errormsg)) $errormsg=''; // Pas erreur
|
if (preg_match('/^-- MySql/i',$errormsg)) $errormsg=''; // Pas erreur
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Renommer fichier sortie en fichier erreur
|
// Renommer fichier sortie en fichier erreur
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ if ($result)
|
|||||||
// Description
|
// Description
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$text=$langs->trans($obj->description);
|
$text=$langs->trans($obj->description);
|
||||||
if (eregi('\((.*)\)',$obj->description,$reg))
|
if (preg_match('/\((.*)\)/i',$obj->description,$reg))
|
||||||
{
|
{
|
||||||
$val=explode(',',$reg[1]);
|
$val=explode(',',$reg[1]);
|
||||||
$text=$langs->trans($val[0], isset($val[1])?$val[1]:'', isset($val[2])?$val[2]:'', isset($val[3])?$val[3]:'', isset($val[4])?$val[4]:'');
|
$text=$langs->trans($val[0], isset($val[1])?$val[1]:'', isset($val[2])?$val[2]:'', isset($val[3])?$val[3]:'', isset($val[4])?$val[4]:'');
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ if ($conf->syslog->enabled)
|
|||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
if ($_REQUEST["action"]=='purge' && ! eregi('^confirm',$_REQUEST["choice"]) && ($_REQUEST["choice"] != 'allfiles' || $_REQUEST["confirm"] == 'yes') )
|
if ($_REQUEST["action"]=='purge' && ! preg_match('/^confirm/i',$_REQUEST["choice"]) && ($_REQUEST["choice"] != 'allfiles' || $_REQUEST["confirm"] == 'yes') )
|
||||||
{
|
{
|
||||||
$filesarray=array();
|
$filesarray=array();
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ if ($message)
|
|||||||
print "\n";
|
print "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eregi('^confirm',$_REQUEST["choice"]))
|
if (preg_match('/^confirm/i',$_REQUEST["choice"]))
|
||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
$formquestion=array();
|
$formquestion=array();
|
||||||
|
|||||||
@@ -185,8 +185,8 @@ foreach ($orders as $key => $value)
|
|||||||
$disabledbyname=0;
|
$disabledbyname=0;
|
||||||
$disabledbymodule=1;
|
$disabledbymodule=1;
|
||||||
$module='';
|
$module='';
|
||||||
if (eregi('NORUN$',$files[$key])) $disabledbyname=1;
|
if (preg_match('/NORUN$/i',$files[$key])) $disabledbyname=1;
|
||||||
if (eregi('^interface_([^_]+)_(.+)\.class\.php',$files[$key],$reg))
|
if (preg_match('/^interface_([^_]+)_(.+)\.class\.php/i',$files[$key],$reg))
|
||||||
{
|
{
|
||||||
// Check if trigger file is for a particular module
|
// Check if trigger file is for a particular module
|
||||||
$module=preg_replace('/^mod/i','',$reg[1]);
|
$module=preg_replace('/^mod/i','',$reg[1]);
|
||||||
|
|||||||
Reference in New Issue
Block a user