Fix: functions "ereg", "ereg_replace", "eregi", "eregi_replace" is deprecated since php 5.3.0
This commit is contained in:
parent
01291c4a7c
commit
0cc93c1015
@ -33,7 +33,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
}
|
||||
|
||||
// Recupere root dolibarr
|
||||
$path=eregi_replace('generate-commande.php','',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('/generate-commande.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require ($path."../htdocs/master.inc.php");
|
||||
include_once(DOL_DOCUMENT_ROOT."/societe.class.php");
|
||||
include_once(DOL_DOCUMENT_ROOT."/contact.class.php");
|
||||
|
||||
@ -32,7 +32,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
}
|
||||
|
||||
// Recupere root dolibarr
|
||||
$path=eregi_replace('generate-facture.php','',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('/generate-facture.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require ($path."../htdocs/master.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/societe.class.php");
|
||||
|
||||
@ -33,7 +33,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
}
|
||||
|
||||
// Recupere root dolibarr
|
||||
$path=eregi_replace('generate-produit.php','',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require ($path."../htdocs/master.inc.php");
|
||||
include_once(DOL_DOCUMENT_ROOT."/societe.class.php");
|
||||
include_once(DOL_DOCUMENT_ROOT."/contact.class.php");
|
||||
|
||||
@ -33,7 +33,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
}
|
||||
|
||||
// Recupere root dolibarr
|
||||
$path=eregi_replace('generate-propale.php','',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('/generate-propale.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require ($path."../htdocs/master.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
|
||||
|
||||
@ -33,7 +33,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
}
|
||||
|
||||
// Recupere root dolibarr
|
||||
$path=eregi_replace('generate-societe.php','',$_SERVER["PHP_SELF"]);
|
||||
$path=preg_replace('/generate-societe.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require ($path."../htdocs/master.inc.php");
|
||||
include_once(DOL_DOCUMENT_ROOT."/societe.class.php");
|
||||
include_once(DOL_DOCUMENT_ROOT."/contact.class.php");
|
||||
|
||||
@ -26,9 +26,9 @@
|
||||
|
||||
// Test if batch mode
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file=__FILE__;
|
||||
if (eregi('([^\\\/]+)$',$script_file,$reg)) $script_file=$reg[1];
|
||||
$path=eregi_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$script_file = __FILE__;
|
||||
if (preg_match('/([^\\/]+)$/i',$script_file,$reg)) $script_file = '/'.$reg[1].'/i';
|
||||
$path=preg_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
echo "Error: You are using PHP for CGI/Web. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
|
||||
@ -26,9 +26,9 @@
|
||||
|
||||
// Test if batch mode
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file=__FILE__;
|
||||
if (eregi('([^\\\/]+)$',$script_file,$reg)) $script_file=$reg[1];
|
||||
$path=eregi_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
$script_file = __FILE__;
|
||||
if (preg_match('/([^\\/]+)$/i',$script_file,$reg)) $script_file = '/'.$reg[1].'/i';
|
||||
$path=preg_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
echo "Error: You are using PHP for CGI/Web. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
|
||||
@ -26,8 +26,8 @@
|
||||
// Test if batch mode
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file=__FILE__;
|
||||
if (eregi('([^\\\/]+)$',$script_file,$reg)) $script_file=$reg[1];
|
||||
$path=eregi_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
if (preg_match('/([^\\/]+)$/i',$script_file,$reg)) $script_file = '/'.$reg[1].'/i';
|
||||
$path=preg_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
|
||||
if (substr($sapi_type, 0, 3) == 'cgi')
|
||||
{
|
||||
@ -123,7 +123,7 @@ else
|
||||
|
||||
// Define working variables
|
||||
$table=strtolower($table);
|
||||
$tablenollx=eregi_replace('llx_','',$table);
|
||||
$tablenollx=preg_replace('/llx_/i','',$table);
|
||||
$class=ucfirst($tablenollx);
|
||||
$classmin=strtolower($class);
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@
|
||||
// Test if batch mode
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file=__FILE__;
|
||||
if (eregi('([^\\\/]+)$',$script_file,$reg)) $script_file=$reg[1];
|
||||
$path=eregi_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
if (preg_match('/([^\\/]+)$/i',$script_file,$reg)) $script_file = '/'.$reg[1].'/i';
|
||||
$path=preg_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
|
||||
if (substr($sapi_type, 0, 3) == 'cgi')
|
||||
{
|
||||
|
||||
@ -54,7 +54,7 @@ class modMyModule extends DolibarrModules
|
||||
// It is used to group modules in module setup page
|
||||
$this->family = "other";
|
||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||
$this->name = eregi_replace('^mod','',get_class($this));
|
||||
$this->name = preg_replace('/^mod/i','',get_class($this));
|
||||
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
|
||||
$this->description = "Description of module MyModule";
|
||||
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
|
||||
|
||||
@ -29,8 +29,8 @@
|
||||
// Test if batch mode and define path of script
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file=__FILE__;
|
||||
if (eregi('([^\\\/]+)$',$script_file,$reg)) $script_file=$reg[1];
|
||||
$path=eregi_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
if (preg_match('/([^\\/]+)$/i',$script_file,$reg)) $script_file = '/'.$reg[1].'/i';
|
||||
$path=preg_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
echo "Error: You are using PHP for CGI/Web. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
|
||||
@ -28,8 +28,8 @@
|
||||
// Test if batch mode
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file=__FILE__;
|
||||
if (eregi('([^\\\/]+)$',$script_file,$reg)) $script_file=$reg[1];
|
||||
$path=eregi_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
if (preg_match('/([^\\/]+)$/i',$script_file,$reg)) $script_file = '/'.$reg[1].'/i';
|
||||
$path=preg_replace($script_file,'',$_SERVER["PHP_SELF"]);
|
||||
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
echo "Error: You ar usingr PH for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
|
||||
@ -713,7 +713,7 @@ class Adherent extends CommonObject
|
||||
|
||||
$error=0;
|
||||
|
||||
dol_syslog("Adherent::Password user=".$user->id." password=".eregi_replace('.','*',$password)." isencrypted=".$isencrypted);
|
||||
dol_syslog("Adherent::Password user=".$user->id." password=".preg_replace('/./i','*',$password)." isencrypted=".$isencrypted);
|
||||
|
||||
// Si nouveau mot de passe non communique, on genere par module
|
||||
if (! $password)
|
||||
|
||||
@ -1090,7 +1090,7 @@ if ($rowid && $action != 'edit')
|
||||
print '</tr>';
|
||||
|
||||
// Password
|
||||
print '<tr><td>'.$langs->trans("Password").'</td><td>'.eregi_replace('.','*',$adh->pass).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Password").'</td><td>'.preg_replace('/./i','*',$adh->pass).'</td></tr>';
|
||||
|
||||
// Type
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
|
||||
|
||||
@ -49,8 +49,8 @@ print '<table class="border" cellspacing="0" cellpadding="3">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Description").'</td><td>'.$langs->trans("URL").'</td></tr>';
|
||||
// Should work with DOL_URL_ROOT='' or DOL_URL_ROOT='/dolibarr'
|
||||
$firstpart=$dolibarr_main_url_root;
|
||||
$regex=DOL_URL_ROOT.'$';
|
||||
$firstpart=eregi_replace($regex,'',$firstpart);
|
||||
$regex='/'.DOL_URL_ROOT.'$/i';
|
||||
$firstpart=preg_replace($regex,'',$firstpart);
|
||||
print '<tr><td>'.$langs->trans("BlankSubscriptionForm").'</td><td><a target="_blank" href="'.DOL_URL_ROOT.'/public/members/new.php'.'">'.$firstpart.DOL_URL_ROOT.'/public/members/new.php'.'</a></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("PublicMemberList").'</td><td><a target="_blank" href="'.DOL_URL_ROOT.'/public/members/public_list.php'.'">'.$firstpart.DOL_URL_ROOT.'/public/members/public_list.php'.'</a></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("PublicMemberCard").'</td><td>'.$firstpart.DOL_URL_ROOT.'/public/members/public_card.php?id=xxx'.'</td></tr>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user