|
From: <dai...@us...> - 2011-07-03 03:27:57
|
Revision: 4620
http://web-erp.svn.sourceforge.net/web-erp/?rev=4620&view=rev
Author: daintree
Date: 2011-07-03 03:27:48 +0000 (Sun, 03 Jul 2011)
Log Message:
-----------
strpos to mb_strpos
Modified Paths:
--------------
trunk/AccountSections.php
trunk/ConfirmDispatch_Invoice.php
trunk/Contracts.php
trunk/Customers.php
trunk/DailySalesInquiry.php
trunk/DeliveryDetails.php
trunk/MRPCreateDemands.php
trunk/Numbers/Words.php
trunk/PO_PDFPurchOrder.php
trunk/PcExpensesTypeTab.php
trunk/PcTypeTabs.php
trunk/SelectCreditItems.php
trunk/Stocks.php
trunk/SuppPriceList.php
trunk/Tax.php
trunk/TaxCategories.php
trunk/TaxProvinces.php
trunk/UnitsOfMeasure.php
trunk/UpgradeDatabase.php
trunk/Z_MakeNewCompany.php
trunk/Z_Upgrade_3.04-3.05.php
trunk/Z_Upgrade_3.05-3.06.php
trunk/Z_Upgrade_3.07-3.08.php
trunk/Z_Upgrade_3.08-3.09.php
trunk/Z_Upgrade_3.09-3.10.php
trunk/Z_Upgrade_3.10-3.11.php
trunk/Z_Upgrade_3.11-4.00.php
trunk/Z_poEditLangModule.php
trunk/api/api_debtortransactions.php
trunk/doc/Change.log
trunk/doc/Manual/ManualAPIFunctions.php
trunk/includes/ConstructSQLForUserDefinedSalesReport.inc
trunk/includes/DateFunctions.inc
trunk/includes/EDIVariableSubstitution.inc
trunk/includes/EDIconfig.inc
trunk/includes/RFC822.php
trunk/includes/class.pdf.php
trunk/includes/phplot/phplot.php
trunk/includes/smtp.php
trunk/includes/tcpdf/CHANGELOG.TXT
trunk/includes/tcpdf/barcodes.php
trunk/includes/tcpdf/tcpdf.php
trunk/install/save.php
trunk/reportwriter/WriteReport.inc
trunk/reportwriter/admin/RCFunctions.inc
trunk/reportwriter/admin/forms/ReportsCritSetup.html
trunk/reportwriter/forms/FormsFilter.html
trunk/reportwriter/forms/ReportsFilter.html
Modified: trunk/AccountSections.php
===================================================================
--- trunk/AccountSections.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/AccountSections.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -86,7 +86,7 @@
$Errors[$i] = 'SectionID';
$i++;
}
- if (isset($_POST['SectionID']) and strpos($_POST['SectionID'],".")>0) {
+ if (isset($_POST['SectionID']) and mb_strpos($_POST['SectionID'],".")>0) {
$InputError = 1;
prnMsg( _('The section number must be an integer'),'error');
$Errors[$i] = 'SectionID';
Modified: trunk/ConfirmDispatch_Invoice.php
===================================================================
--- trunk/ConfirmDispatch_Invoice.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/ConfirmDispatch_Invoice.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -800,7 +800,7 @@
/*Test to see if the item being sold is an asset */
if (substr($OrderLine->StockID,0,6)=='ASSET-'){
$IsAsset = true;
- $HyphenOccursAt = strpos($OrderLine->StockID,'-',6);
+ $HyphenOccursAt = mb_strpos($OrderLine->StockID,'-',6);
if ($HyphenOccursAt == false){
$AssetNumber = intval(substr($OrderLine->StockID,6));
} else {
Modified: trunk/Contracts.php
===================================================================
--- trunk/Contracts.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/Contracts.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -224,7 +224,7 @@
prnMsg(_('The contract reference is expected to be more than 2 characters long. Please alter the contract reference before proceeding.'),'error');
$InputError = true;
}
- if(ContainsIllegalCharacters($_POST['ContractRef']) OR strpos($_POST['ContractRef'],' ')>0){
+ if(ContainsIllegalCharacters($_POST['ContractRef']) OR mb_strpos($_POST['ContractRef'],' ')>0){
prnMsg(_('The contract reference cannot contain any spaces, slashes, or inverted commas. Please alter the contract reference before proceeding.'),'error');
$InputError = true;
}
Modified: trunk/Customers.php
===================================================================
--- trunk/Customers.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/Customers.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -49,7 +49,7 @@
prnMsg( _('The debtor code cannot be empty'),'error');
$Errors[$i] = 'DebtorNo';
$i++;
- } elseif ($_SESSION['AutoDebtorNo']==0 AND (ContainsIllegalCharacters($_POST['DebtorNo']) OR strpos($_POST['DebtorNo'], ' '))) {
+ } elseif ($_SESSION['AutoDebtorNo']==0 AND (ContainsIllegalCharacters($_POST['DebtorNo']) OR mb_strpos($_POST['DebtorNo'], ' '))) {
$InputError = 1;
prnMsg( _('The customer code cannot contain any of the following characters') . " . - ' & + \" " . _('or a space'),'error');
$Errors[$i] = 'DebtorNo';
Modified: trunk/DailySalesInquiry.php
===================================================================
--- trunk/DailySalesInquiry.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/DailySalesInquiry.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -59,11 +59,11 @@
echo '</form></div>';
echo '<br />';
/*Now get and display the sales data returned */
-if (strpos($EndDateSQL,'/')) {
+if (mb_strpos($EndDateSQL,'/')) {
$Date_Array = explode('/',$EndDateSQL);
-} elseif (strpos ($EndDateSQL,'-')) {
+} elseif (mb_strpos ($EndDateSQL,'-')) {
$Date_Array = explode('-',$EndDateSQL);
-} elseif (strpos ($EndDateSQL,'.')) {
+} elseif (mb_strpos ($EndDateSQL,'.')) {
$Date_Array = explode('.',$EndDateSQL);
}
Modified: trunk/DeliveryDetails.php
===================================================================
--- trunk/DeliveryDetails.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/DeliveryDetails.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -61,7 +61,7 @@
$InputErrors =1;
prnMsg(_('You should enter the street address in the box provided') . '. ' . _('Orders cannot be accepted without a valid street address'),'error');
}
-// if (strpos($_POST['BrAdd1'],_('Box'))>0){
+// if (mb_strpos($_POST['BrAdd1'],_('Box'))>0){
// prnMsg(_('You have entered the word') . ' "' . _('Box') . '" ' . _('in the street address') . '. ' . _('Items cannot be delivered to') . ' ' ._('box') . ' ' . _('addresses'),'warn');
// }
if (!is_numeric($_POST['FreightCost'])){
Modified: trunk/MRPCreateDemands.php
===================================================================
--- trunk/MRPCreateDemands.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/MRPCreateDemands.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -83,11 +83,11 @@
// Create array of dates based on DistDate and adding either weeks or months
$FormatedDistdate = FormatDateForSQL($_POST['DistDate']);
-if (strpos($FormatedDistdate,"/")) {
+if (mb_strpos($FormatedDistdate,"/")) {
list($yyyy,$mm,$dd) = explode("/",$FormatedDistdate);
-} else if (strpos($FormatedDistdate,"-")) {
+} else if (mb_strpos($FormatedDistdate,"-")) {
list($yyyy,$mm,$dd) = explode("-",$FormatedDistdate);
-} else if (strpos($FormatedDistdate,".")) {
+} else if (mb_strpos($FormatedDistdate,".")) {
list($yyyy,$mm,$dd) = explode(".",$FormatedDistdate);
}
Modified: trunk/Numbers/Words.php
===================================================================
--- trunk/Numbers/Words.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/Numbers/Words.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -64,8 +64,8 @@
//Phil mods to ensure correct translation used.
if (!file_exists('Numbers/Words/lang.' . $locale . '.php')){
//try to drop off the .utf8 suffix then recheck
- if (strpos($locale,'.utf8')){
- $locale = substr($locale, 0,strpos($locale,'.utf8'));
+ if (mb_strpos($locale,'.utf8')){
+ $locale = substr($locale, 0,mb_strpos($locale,'.utf8'));
}
if (!file_exists('Numbers/Words/lang.' . $locale . '.php')){
$locale = substr($locale,0,2);
@@ -132,7 +132,7 @@
@$obj =& new $classname;
- if (strpos($num, '.') === false)
+ if (mb_strpos($num, '.') === false)
{
$ret = trim($obj->toCurrencyWords($int_curr, $num));
} else {
Modified: trunk/PO_PDFPurchOrder.php
===================================================================
--- trunk/PO_PDFPurchOrder.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/PO_PDFPurchOrder.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -385,7 +385,7 @@
if (DB_num_rows($ContactsResult)>0){
echo '<tr><td>'. _('Email to') .':</td><td><select name="EmailTo">';
while ($ContactDetails = DB_fetch_array($ContactsResult)){
- if (mb_strlen($ContactDetails['email'])>2 AND strpos($ContactDetails['email'],'@')>0){
+ if (mb_strlen($ContactDetails['email'])>2 AND mb_strpos($ContactDetails['email'],'@')>0){
if ($_POST['EmailTo']==$ContactDetails['email']){
echo '<option selected value="' . $ContactDetails['email'] . '">' . $ContactDetails['Contact'] . ' - ' . $ContactDetails['email'] . '</option>';
} else {
Modified: trunk/PcExpensesTypeTab.php
===================================================================
--- trunk/PcExpensesTypeTab.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/PcExpensesTypeTab.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -17,7 +17,7 @@
$SelectedType='';
}
-if (!isset($_GET['delete']) and (ContainsIllegalCharacters($SelectedType) OR strpos($SelectedType,' ')>0)){
+if (!isset($_GET['delete']) and (ContainsIllegalCharacters($SelectedType) OR mb_strpos($SelectedType,' ')>0)){
$InputError = 1;
prnMsg(_('The petty cash tab type contain any of the following characters " \' - & or a space'),'error');
}
Modified: trunk/PcTypeTabs.php
===================================================================
--- trunk/PcTypeTabs.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/PcTypeTabs.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -41,7 +41,7 @@
echo prnMsg(_('The tab code must be twenty characters or less long'),'error');
$Errors[$i] = 'TypeTabCode';
$i++;
- }elseif (ContainsIllegalCharacters($_POST['TypeTabCode']) OR strpos($_POST['TypeTabCode'],' ')>0){
+ }elseif (ContainsIllegalCharacters($_POST['TypeTabCode']) OR mb_strpos($_POST['TypeTabCode'],' ')>0){
$InputError = 1;
prnMsg(_('The petty cash tab type code cannot contain any of the illegal characters'),'error');
} elseif (mb_strlen($_POST['TypeTabDescription']) >50) {
Modified: trunk/SelectCreditItems.php
===================================================================
--- trunk/SelectCreditItems.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/SelectCreditItems.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -116,8 +116,8 @@
/*will only be true if page called from customer selection form
parse the $Select string into customer code and branch code */
- $_SESSION['CreditItems']->Branch = substr($_POST['Select'],strpos($_POST['Select'],' - ')+3);
- $_POST['Select'] = substr($_POST['Select'],0,strpos($_POST['Select'],' - '));
+ $_SESSION['CreditItems']->Branch = substr($_POST['Select'],mb_strpos($_POST['Select'],' - ')+3);
+ $_POST['Select'] = substr($_POST['Select'],0,mb_strpos($_POST['Select'],' - '));
/*Now retrieve customer information - name, salestype, currency, terms etc */
Modified: trunk/Stocks.php
===================================================================
--- trunk/Stocks.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/Stocks.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -102,7 +102,7 @@
$Errors[$i] = 'StockID';
$i++;
}
- if (ContainsIllegalCharacters($StockID) OR strpos($StockID,' ')) {
+ if (ContainsIllegalCharacters($StockID) OR mb_strpos($StockID,' ')) {
$InputError = 1;
prnMsg(_('The stock item code cannot contain any of the following characters') . " - ' & + \" \\ " . _('or a space'),'error');
$Errors[$i] = 'StockID';
Modified: trunk/SuppPriceList.php
===================================================================
--- trunk/SuppPriceList.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/SuppPriceList.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -138,11 +138,11 @@
// 4) Height 5) Text 6) Alignment 7) Border 8) Fill - True to use SetFillColor
// and False to set to transparent
- if (strpos($myrow[3],'-')) {
+ if (mb_strpos($myrow[3],'-')) {
$DateArray=explode('-', $myrow[3]);
- } else if (strpos($myrow[3],'/')) {
+ } else if (mb_strpos($myrow[3],'/')) {
$DateArray=explode('/', $myrow[3]);
- } else if (strpos($myrow[3],'.')) {
+ } else if (mb_strpos($myrow[3],'.')) {
$DateArray=explode('.', $myrow[3]);
}
$dateprice=date($_SESSION['DefaultDateFormat'], mktime(0,0,0,$DateArray[1],$DateArray[2],$DateArray[0]));
Modified: trunk/Tax.php
===================================================================
--- trunk/Tax.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/Tax.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -127,9 +127,9 @@
/*Now do the inputs from SuppTrans */
/*Only have dates in SuppTrans no periods so need to get the starting date */
- if (strpos($PeriodEnd,'/')) {
+ if (mb_strpos($PeriodEnd,'/')) {
$Date_Array = explode('/',$PeriodEnd);
- } elseif (strpos($PeriodEnd,'.')) {
+ } elseif (mb_strpos($PeriodEnd,'.')) {
$Date_Array = explode('.',$PeriodEnd);
}
if ($_SESSION['DefaultDateFormat']=='d/m/Y'){
Modified: trunk/TaxCategories.php
===================================================================
--- trunk/TaxCategories.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/TaxCategories.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -26,7 +26,7 @@
//first off validate inputs sensible
- if (strpos($_POST['TaxCategoryName'],'&')>0 OR strpos($_POST['TaxCategoryName'],"'")>0) {
+ if (mb_strpos($_POST['TaxCategoryName'],'&')>0 OR mb_strpos($_POST['TaxCategoryName'],"'")>0) {
$InputError = 1;
prnMsg( _('The tax category name cannot contain the character') . " '&' " . _('or the character') ." '",'error');
}
Modified: trunk/TaxProvinces.php
===================================================================
--- trunk/TaxProvinces.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/TaxProvinces.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -25,7 +25,7 @@
//first off validate inputs sensible
- if (strpos($_POST['TaxProvinceName'],'&')>0 OR strpos($_POST['TaxProvinceName'],"'")>0) {
+ if (mb_strpos($_POST['TaxProvinceName'],'&')>0 OR mb_strpos($_POST['TaxProvinceName'],"'")>0) {
$InputError = 1;
prnMsg( _('The tax province name cannot contain the character') . " '&' " . _('or the character') ." '",'error');
}
Modified: trunk/UnitsOfMeasure.php
===================================================================
--- trunk/UnitsOfMeasure.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/UnitsOfMeasure.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -25,7 +25,7 @@
//first off validate inputs sensible
- if (strpos($_POST['MeasureName'],'&')>0 OR strpos($_POST['MeasureName'],"'")>0) {
+ if (mb_strpos($_POST['MeasureName'],'&')>0 OR mb_strpos($_POST['MeasureName'],"'")>0) {
$InputError = 1;
prnMsg( _('The unit of measure cannot contain the character') . " '&' " . _('or the character') ." '",'error');
}
Modified: trunk/UpgradeDatabase.php
===================================================================
--- trunk/UpgradeDatabase.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/UpgradeDatabase.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -159,7 +159,7 @@
if (substr($SQLEntries[$i],0,8) == 'LANGUAGE'){
$InAFunction = false;
}
- if (strpos($SQLEntries[$i],';')>0 AND ! $InAFunction){
+ if (mb_strpos($SQLEntries[$i],';')>0 AND ! $InAFunction){
$sql = substr($sql,0,mb_strlen($sql)-1);
$result = DB_query($sql, $db, '','', false, false);
echo '<tr><td>' . $sql . '</td>';
Modified: trunk/Z_MakeNewCompany.php
===================================================================
--- trunk/Z_MakeNewCompany.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/Z_MakeNewCompany.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -118,7 +118,7 @@
if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){
$InAFunction = false;
}
- if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){
+ if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){
$SQL = substr($SQL,0,mb_strlen($SQL)-1);
$result = DB_query($SQL, $db, $ErrMsg);
$SQL='';
Modified: trunk/Z_Upgrade_3.04-3.05.php
===================================================================
--- trunk/Z_Upgrade_3.04-3.05.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/Z_Upgrade_3.04-3.05.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -49,7 +49,7 @@
if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){
$InAFunction = false;
}
- if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){
+ if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){
$SQL = substr($SQL,0,mb_strlen($SQL)-1);
$result = DB_query($SQL, $db, $ErrMsg);
$SQL='';
Modified: trunk/Z_Upgrade_3.05-3.06.php
===================================================================
--- trunk/Z_Upgrade_3.05-3.06.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/Z_Upgrade_3.05-3.06.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -41,7 +41,7 @@
if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){
$InAFunction = false;
}
- if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){
+ if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){
$SQL = substr($SQL,0,mb_strlen($SQL)-1);
$result = DB_query($SQL, $db, $ErrMsg);
$SQL='';
Modified: trunk/Z_Upgrade_3.07-3.08.php
===================================================================
--- trunk/Z_Upgrade_3.07-3.08.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/Z_Upgrade_3.07-3.08.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -41,7 +41,7 @@
if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){
$InAFunction = false;
}
- if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){
+ if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){
$SQL = substr($SQL,0,mb_strlen($SQL)-1);
$result = DB_query($SQL, $db, $ErrMsg);
$SQL='';
Modified: trunk/Z_Upgrade_3.08-3.09.php
===================================================================
--- trunk/Z_Upgrade_3.08-3.09.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/Z_Upgrade_3.08-3.09.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -41,7 +41,7 @@
if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){
$InAFunction = false;
}
- if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){
+ if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){
$SQL = substr($SQL,0,mb_strlen($SQL)-1);
$result = DB_query($SQL, $db, $ErrMsg);
$SQL='';
Modified: trunk/Z_Upgrade_3.09-3.10.php
===================================================================
--- trunk/Z_Upgrade_3.09-3.10.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/Z_Upgrade_3.09-3.10.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -41,7 +41,7 @@
if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){
$InAFunction = false;
}
- if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){
+ if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){
$SQL = substr($SQL,0,mb_strlen($SQL)-1);
$result = DB_query($SQL, $db, $ErrMsg);
$SQL='';
Modified: trunk/Z_Upgrade_3.10-3.11.php
===================================================================
--- trunk/Z_Upgrade_3.10-3.11.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/Z_Upgrade_3.10-3.11.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -51,7 +51,7 @@
if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){
$InAFunction = false;
}
- if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){
+ if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){
$sql = substr($sql,0,mb_strlen($sql)-1);
$result = DB_query($sql, $db, $ErrMsg, $DBMsg, false, false);
switch (DB_error_no($db)) {
Modified: trunk/Z_Upgrade_3.11-4.00.php
===================================================================
--- trunk/Z_Upgrade_3.11-4.00.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/Z_Upgrade_3.11-4.00.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -51,7 +51,7 @@
if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){
$InAFunction = false;
}
- if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){
+ if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){
$sql = substr($sql,0,mb_strlen($sql)-1);
$result = DB_query($sql, $db, $ErrMsg, $DBMsg, false, false);
switch (DB_error_no($db)) {
Modified: trunk/Z_poEditLangModule.php
===================================================================
--- trunk/Z_poEditLangModule.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/Z_poEditLangModule.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -144,7 +144,7 @@
for ($i=1; $i<=$TotalLines; $i++) {
- $b = strpos($AlsoIn[$i], $_POST['module']);
+ $b = mb_strpos($AlsoIn[$i], $_POST['module']);
if ($b === False) {
/* skip it */
Modified: trunk/api/api_debtortransactions.php
===================================================================
--- trunk/api/api_debtortransactions.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/api/api_debtortransactions.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -20,11 +20,11 @@
//for MySQL dates are in the format YYYY-mm-dd
- if (strpos($DateEntry,'/')) {
+ if (mb_strpos($DateEntry,'/')) {
$Date_Array = explode('/',$DateEntry);
- } elseif (strpos ($DateEntry,'-')) {
+ } elseif (mb_strpos ($DateEntry,'-')) {
$Date_Array = explode('-',$DateEntry);
- } elseif (strpos ($DateEntry,'.')) {
+ } elseif (mb_strpos ($DateEntry,'.')) {
$Date_Array = explode('.',$DateEntry);
}
@@ -53,9 +53,9 @@
$result=DB_query($sql, $db);
$myrow=DB_fetch_array($result);
$DateFormat=$myrow[0];
- if (strpos($TranDate,'/')>0) {
+ if (mb_strpos($TranDate,'/')>0) {
$DateArray = explode('/',$TranDate);
- } elseif (strpos($TranDate,'.')>0) {
+ } elseif (mb_strpos($TranDate,'.')>0) {
$DateArray = explode('.',$TranDate);
}
if ($DateFormat=='d/m/Y') {
Modified: trunk/doc/Change.log
===================================================================
--- trunk/doc/Change.log 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/doc/Change.log 2011-07-03 03:27:48 UTC (rev 4620)
@@ -2666,7 +2666,7 @@
28/8/04 Steve - Minor changes to theme default.css files
28/8/04 Steve - SelectCustomer.php SelectProduct.php SelectSupplier.php all modified to allow paging where a large result set is returned
25/8/04 SelectCreditItems.php now allows text line entries with each line of the credit note
-23/8/04 SelectOrderItems.php SelectCreditItems.php strrpos works differently in PHP 5 changed to use strpos
+23/8/04 SelectOrderItems.php SelectCreditItems.php strrpos works differently in PHP 5 changed to use mb_strpos
14/8/04 Changed ConfirmDispatch_Invoice.php to allow entry of consignment reference also changed PrintCustTrans.php and PDFPrintCustTransPageHeader.inc to print out the narrative on sales order lines and the consignment number
14/8/04 Changed SelectOrderItems.php to allow entry of narrative and update narrative entries also show warning when quick entries not processed.
14/8/04 Changed DefineCartClass.inc to have a Narrative variable in LineItems and a Consignment variable in the header
Modified: trunk/doc/Manual/ManualAPIFunctions.php
===================================================================
--- trunk/doc/Manual/ManualAPIFunctions.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/doc/Manual/ManualAPIFunctions.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -26,7 +26,7 @@
$weberppassword = $myrow[0];
$ServerString = $_SERVER['HTTP_HOST'].$rootpath;
-$FirstBitOfURL = substr($ServerString,0,strpos($ServerString,'/doc/Manual'));
+$FirstBitOfURL = substr($ServerString,0,mb_strpos($ServerString,'/doc/Manual'));
$ServerURL = "http://". $FirstBitOfURL ."/api/api_xml-rpc.php";
Modified: trunk/includes/ConstructSQLForUserDefinedSalesReport.inc
===================================================================
--- trunk/includes/ConstructSQLForUserDefinedSalesReport.inc 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/includes/ConstructSQLForUserDefinedSalesReport.inc 2011-07-03 03:27:48 UTC (rev 4620)
@@ -257,7 +257,7 @@
The first 6 Columns are defined by the group by fields so for eg the first col
defined will be col 7 and so on - thats why need to add 6 to the col defined as */
- $length_ColNum = strpos($SQLSelectCls, 'AS col' . ($Cols['colnumerator'] + 8) , 7);
+ $length_ColNum = mb_strpos($SQLSelectCls, 'AS col' . ($Cols['colnumerator'] + 8) , 7);
If ($length_ColNum == 0) {
@@ -274,9 +274,9 @@
/*find the comma just before the Select Cls statement for the numerator column */
do {
- $strt_ColNum = strpos( $SQLSelectCls, ',', $strt_ColNum + 1) + 1;
+ $strt_ColNum = mb_strpos( $SQLSelectCls, ',', $strt_ColNum + 1) + 1;
- } while (strpos($SQLSelectCls, ',', $strt_ColNum) < $length_ColNum && strpos($SQLSelectCls, ',' , $strt_ColNum)!=0);
+ } while (mb_strpos($SQLSelectCls, ',', $strt_ColNum) < $length_ColNum && mb_strpos($SQLSelectCls, ',' , $strt_ColNum)!=0);
/*The length of the element in the select clause defining the column will be from the comma to the
@@ -288,7 +288,7 @@
/*The denominator column is also required if the constant is not used so do the same again for the denominator */
- $length_ColDen = strpos($SQLSelectCls, 'AS col' . (($Cols['coldenominator']) + 8), 7);
+ $length_ColDen = mb_strpos($SQLSelectCls, 'AS col' . (($Cols['coldenominator']) + 8), 7);
If ($length_ColDen == 0){
prnMsg (_('Calculated fields must use columns defined in the report specification') . '. ' . _('The denominator column number entered for this calculation is not defined in the report'),'error',_('Calculation With Undefined Denominator'));
Exit;
@@ -299,9 +299,9 @@
/*find the comma just before the Select Cls statement for the denominator column */
do {
- $strt_ColDen = strpos( $SQLSelectCls, ',', $strt_ColDen +1)+1;
+ $strt_ColDen = mb_strpos( $SQLSelectCls, ',', $strt_ColDen +1)+1;
- } while (strpos($SQLSelectCls, ',', $strt_ColDen) < $length_ColDen && strpos($SQLSelectCls, ',' , $strt_ColDen)!=0);
+ } while (mb_strpos($SQLSelectCls, ',', $strt_ColDen) < $length_ColDen && mb_strpos($SQLSelectCls, ',' , $strt_ColDen)!=0);
$length_ColDen = $length_ColDen - $strt_ColDen - 1;
Modified: trunk/includes/DateFunctions.inc
===================================================================
--- trunk/includes/DateFunctions.inc 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/includes/DateFunctions.inc 2011-07-03 03:27:48 UTC (rev 4620)
@@ -21,11 +21,11 @@
//echo '<BR>The date entered is ' . $DateEntry;
- if (strpos($DateEntry,'/')) {
+ if (mb_strpos($DateEntry,'/')) {
$Date_Array = explode('/',$DateEntry);
- } elseif (strpos ($DateEntry,'-')) {
+ } elseif (mb_strpos ($DateEntry,'-')) {
$Date_Array = explode('-',$DateEntry);
- } elseif (strpos ($DateEntry,'.')) {
+ } elseif (mb_strpos ($DateEntry,'.')) {
$Date_Array = explode('.',$DateEntry);
} elseif (mb_strlen($DateEntry)==6) {
$Date_Array[0]= substr($DateEntry,0,2);
@@ -83,11 +83,11 @@
function MonthAndYearFromSQLDate($DateEntry) {
- if (strpos($DateEntry,'/')) {
+ if (mb_strpos($DateEntry,'/')) {
$Date_Array = explode('/',$DateEntry);
- } elseif (strpos ($DateEntry,'-')) {
+ } elseif (mb_strpos ($DateEntry,'-')) {
$Date_Array = explode('-',$DateEntry);
- } elseif (strpos ($DateEntry,'.')) {
+ } elseif (mb_strpos ($DateEntry,'.')) {
$Date_Array = explode('.',$DateEntry);
}
@@ -101,11 +101,11 @@
function DayOfWeekFromSQLDate($DateEntry) {
- if (strpos($DateEntry,'/')) {
+ if (mb_strpos($DateEntry,'/')) {
$Date_Array = explode('/',$DateEntry);
- } elseif (strpos ($DateEntry,'-')) {
+ } elseif (mb_strpos ($DateEntry,'-')) {
$Date_Array = explode('-',$DateEntry);
- } elseif (strpos ($DateEntry,'.')) {
+ } elseif (mb_strpos ($DateEntry,'.')) {
$Date_Array = explode('.',$DateEntry);
}
@@ -119,11 +119,11 @@
function DayOfMonthFromSQLDate($DateEntry) {
- if (strpos($DateEntry,'/')) {
+ if (mb_strpos($DateEntry,'/')) {
$Date_Array = explode('/',$DateEntry);
- } elseif (strpos ($DateEntry,'-')) {
+ } elseif (mb_strpos ($DateEntry,'-')) {
$Date_Array = explode('-',$DateEntry);
- } elseif (strpos ($DateEntry,'.')) {
+ } elseif (mb_strpos ($DateEntry,'.')) {
$Date_Array = explode('.',$DateEntry);
}
@@ -154,11 +154,11 @@
//for MySQL dates are in the format YYYY-mm-dd
- if (strpos($DateEntry,'/')) {
+ if (mb_strpos($DateEntry,'/')) {
$Date_Array = explode('/',$DateEntry);
- } elseif (strpos ($DateEntry,'-')) {
+ } elseif (mb_strpos ($DateEntry,'-')) {
$Date_Array = explode('-',$DateEntry);
- } elseif (strpos ($DateEntry,'.')) {
+ } elseif (mb_strpos ($DateEntry,'.')) {
$Date_Array = explode('.',$DateEntry);
} else {
prnMsg(_('The date does not appear to be in a valid format. The date being converted from SQL format was:') . ' ' . $DateEntry,'error');
@@ -199,11 +199,11 @@
//for MySQL dates are in the format YYYY-mm-dd
//EDI format 102 dates are in the format CCYYMMDD - just need to lose the seperator
- if (strpos($DateEntry,'/')) {
+ if (mb_strpos($DateEntry,'/')) {
$Date_Array = explode('/',$DateEntry);
- } elseif (strpos ($DateEntry,'-')) {
+ } elseif (mb_strpos ($DateEntry,'-')) {
$Date_Array = explode('-',$DateEntry);
- } elseif (strpos ($DateEntry,'.')) {
+ } elseif (mb_strpos ($DateEntry,'.')) {
$Date_Array = explode('.',$DateEntry);
}
@@ -223,11 +223,11 @@
$DateEntry = trim($DateEntry);
- if (strpos($DateEntry,'/')) {
+ if (mb_strpos($DateEntry,'/')) {
$Date_Array = explode('/',$DateEntry);
- } elseif (strpos ($DateEntry,'-')) {
+ } elseif (mb_strpos ($DateEntry,'-')) {
$Date_Array = explode('-',$DateEntry);
- } elseif (strpos ($DateEntry,'.')) {
+ } elseif (mb_strpos ($DateEntry,'.')) {
$Date_Array = explode('.',$DateEntry);
} elseif (mb_strlen($DateEntry)==6) {
$Date_Array[0]= substr($DateEntry,0,2);
@@ -332,11 +332,11 @@
$DateEntry =trim($DateEntry);
- if (strpos($DateEntry,'/')) {
+ if (mb_strpos($DateEntry,'/')) {
$Date_Array = explode('/',$DateEntry);
- } elseif (strpos ($DateEntry,'-')) {
+ } elseif (mb_strpos ($DateEntry,'-')) {
$Date_Array = explode('-',$DateEntry);
- } elseif (strpos ($DateEntry,'.')) {
+ } elseif (mb_strpos ($DateEntry,'.')) {
$Date_Array = explode('.',$DateEntry);
} elseif (mb_strlen($DateEntry)==6) {
$Date_Array[0]= substr($DateEntry,0,2);
@@ -388,11 +388,11 @@
$DateEntry = trim($DateEntry);
- if (strpos($DateEntry,'/')) {
+ if (mb_strpos($DateEntry,'/')) {
$Date_Array = explode('/',$DateEntry);
- } elseif (strpos ($DateEntry,'-')) {
+ } elseif (mb_strpos ($DateEntry,'-')) {
$Date_Array = explode('-',$DateEntry);
- } elseif (strpos ($DateEntry,'.')) {
+ } elseif (mb_strpos ($DateEntry,'.')) {
$Date_Array = explode('.',$DateEntry);
} elseif (mb_strlen($DateEntry)==6) {
$Date_Array[0]= substr($DateEntry,0,2);
@@ -455,11 +455,11 @@
$DateEntry = trim($DateEntry);
- if (strpos($DateEntry,'/')) {
+ if (mb_strpos($DateEntry,'/')) {
$Date_Array = explode('/',$DateEntry);
- } elseif (strpos ($DateEntry,'-')) {
+ } elseif (mb_strpos ($DateEntry,'-')) {
$Date_Array = explode('-',$DateEntry);
- } elseif (strpos ($DateEntry,'.')) {
+ } elseif (mb_strpos ($DateEntry,'.')) {
$Date_Array = explode('.',$DateEntry);
} elseif (mb_strlen($DateEntry)==6) {
$Date_Array[0]= substr($DateEntry,0,2);
@@ -581,11 +581,11 @@
$TranDate = trim($TranDate);
- if (strpos($TranDate,'/')) {
+ if (mb_strpos($TranDate,'/')) {
$Date_Array = explode('/',$TranDate);
- } elseif (strpos ($TranDate,'-')) {
+ } elseif (mb_strpos ($TranDate,'-')) {
$Date_Array = explode('-',$TranDate);
- } elseif (strpos ($TranDate,'.')) {
+ } elseif (mb_strpos ($TranDate,'.')) {
$Date_Array = explode('.',$TranDate);
}
@@ -648,11 +648,11 @@
$DateToAddTo = trim($DateToAddTo);
- if (strpos($DateToAddTo,'/')) {
+ if (mb_strpos($DateToAddTo,'/')) {
$Date_Array = explode('/',$DateToAddTo);
- } elseif (strpos ($DateToAddTo,'-')) {
+ } elseif (mb_strpos ($DateToAddTo,'-')) {
$Date_Array = explode('-',$DateToAddTo);
- } elseif (strpos ($DateToAddTo,'.')) {
+ } elseif (mb_strpos ($DateToAddTo,'.')) {
$Date_Array = explode('.',$DateToAddTo);
}
@@ -723,18 +723,18 @@
$Date1 = trim($Date1);
$Date2 = trim($Date2);
- if (strpos($Date1,'/')) {
+ if (mb_strpos($Date1,'/')) {
$Date1_array = explode('/',$Date1);
- } elseif (strpos ($Date1,'-')) {
+ } elseif (mb_strpos ($Date1,'-')) {
$Date1_array = explode('-',$Date1);
- } elseif (strpos ($Date1,'.')) {
+ } elseif (mb_strpos ($Date1,'.')) {
$Date1_array = explode('.',$Date1);
}
- if (strpos($Date2,'/')) {
+ if (mb_strpos($Date2,'/')) {
$Date2_array = explode('/',$Date2);
- } elseif (strpos ($Date2,'-')) {
+ } elseif (mb_strpos ($Date2,'-')) {
$Date2_array = explode('-',$Date2);
- } elseif (strpos ($Date2,'.')) {
+ } elseif (mb_strpos ($Date2,'.')) {
$Date2_array = explode('.',$Date2);
}
@@ -850,11 +850,11 @@
/* Convert the transaction date into a unix time stamp.*/
- if (strpos($TransDate,'/')) {
+ if (mb_strpos($TransDate,'/')) {
$Date_Array = explode('/',$TransDate);
- } elseif (strpos ($TransDate,'-')) {
+ } elseif (mb_strpos ($TransDate,'-')) {
$Date_Array = explode('-',$TransDate);
- } elseif (strpos ($TransDate,'.')) {
+ } elseif (mb_strpos ($TransDate,'.')) {
$Date_Array = explode('.',$TransDate);
}
if (($_SESSION['DefaultDateFormat']=='d/m/Y') or ($_SESSION['DefaultDateFormat']=='d.m.Y')){
Modified: trunk/includes/EDIVariableSubstitution.inc
===================================================================
--- trunk/includes/EDIVariableSubstitution.inc 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/includes/EDIVariableSubstitution.inc 2011-07-03 03:27:48 UTC (rev 4620)
@@ -5,14 +5,14 @@
$PositionPointer = 0;
$NewLineText ='';
/* now get each occurence of [ in the line */
- while (strpos ($MsgLineText,'[',$PositionPointer)!=False){
+ while (mb_strpos ($MsgLineText,'[',$PositionPointer)!=False){
$LastPositionPointer = $PositionPointer;
- $PositionPointer = strpos ($MsgLineText,'[',$PositionPointer);
+ $PositionPointer = mb_strpos ($MsgLineText,'[',$PositionPointer);
$NewLineText = $NewLineText . substr($MsgLineText,$LastPositionPointer,$PositionPointer-$LastPositionPointer);
$LastPositionPointer = $PositionPointer;
- $PositionPointer = strpos ($MsgLineText,']',$PositionPointer);
+ $PositionPointer = mb_strpos ($MsgLineText,']',$PositionPointer);
$VariableName = substr($MsgLineText,$LastPositionPointer+1,$PositionPointer-$LastPositionPointer-1);
Modified: trunk/includes/EDIconfig.inc
===================================================================
--- trunk/includes/EDIconfig.inc 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/includes/EDIconfig.inc 2011-07-03 03:27:48 UTC (rev 4620)
@@ -58,14 +58,14 @@
$PoistionPointer = 0;
$NewLineText ='';
/* now get each occurence of [ in the line */
- while (strpos ($LineDetails['linetext'],'[',$PoistionPointer)!=False){
+ while (mb_strpos ($LineDetails['linetext'],'[',$PoistionPointer)!=False){
$LastPositionPointer = $PoistionPointer;
- $PositionPointer = strpos ($LineDetails['linetext'],'[',$PoistionPointer);
+ $PositionPointer = mb_strpos ($LineDetails['linetext'],'[',$PoistionPointer);
$NewLineText = $NewLineText . substr($LineDetails['linetext'],$LastPositionPointer,$PoistionPointer-$LastPositionPointer);
$LastPositionPointer = $PoistionPointer;
- $PositionPointer = strpos ($LineDetails['linetext'],']',$PoistionPointer);
+ $PositionPointer = mb_strpos ($LineDetails['linetext'],']',$PoistionPointer);
$VariableName = substr($LineDetails['linetext'],$LastPositionPointer,$PoistionPointer-$LastPositionPointer);
Modified: trunk/includes/RFC822.php
===================================================================
--- trunk/includes/RFC822.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/includes/RFC822.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -211,7 +211,7 @@
// brackets/quotes etc then something's fubar.
// First check there's a colon at all:
- if (strpos($string, ':') === false) {
+ if (mb_strpos($string, ':') === false) {
$this->error = 'Invalid address: ' . $string;
return false;
}
@@ -579,7 +579,7 @@
$comments[] = $comment;
// +1 is for the trailing )
- $_mailbox = substr($_mailbox, strpos($_mailbox, $comment)+mb_strlen($comment)+1);
+ $_mailbox = substr($_mailbox, mb_strpos($_mailbox, $comment)+mb_strlen($comment)+1);
} else {
break;
}
@@ -647,7 +647,7 @@
function _validateRouteAddr($route_addr)
{
// Check for colon.
- if (strpos($route_addr, ':') !== false) {
+ if (mb_strpos($route_addr, ':') !== false) {
$parts = explode(':', $route_addr);
$route = $this->_splitCheck($parts, ':');
} else {
@@ -784,7 +784,7 @@
$addr_spec = trim($addr_spec);
// Split on @ sign if there is one.
- if (strpos($addr_spec, '@') !== false) {
+ if (mb_strpos($addr_spec, '@') !== false) {
$parts = explode('@', $addr_spec);
$local_part = $this->_splitCheck($parts, '@');
$domain = substr($addr_spec, mb_strlen($local_part . '@'));
Modified: trunk/includes/class.pdf.php
===================================================================
--- trunk/includes/class.pdf.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/includes/class.pdf.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -282,13 +282,13 @@
$b2='LR';
} else {
$b2='';
- if(is_int(strpos($border,'L'))) {
+ if(is_int(mb_strpos($border,'L'))) {
$b2.='L';
}
- if(is_int(strpos($border,'R'))) {
+ if(is_int(mb_strpos($border,'R'))) {
$b2.='R';
}
- $b=is_int(strpos($border,'T')) ? $b2.'T' : $b2;
+ $b=is_int(mb_strpos($border,'T')) ? $b2.'T' : $b2;
}
}
$sep=-1;
Modified: trunk/includes/phplot/phplot.php
===================================================================
--- trunk/includes/phplot/phplot.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/includes/phplot/phplot.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -1850,7 +1850,7 @@
$asked = strtolower(trim($which_opt));
# Look for the supplied value in a comma/space separated list.
- if (strpos(", $which_acc,", ", $asked,") !== False)
+ if (mb_strpos(", $which_acc,", ", $asked,") !== False)
return $asked;
$this->PrintError("$which_func(): '$which_opt' not in available choices: '$which_acc'.");
@@ -1889,7 +1889,7 @@
*/
protected function CheckDataType($valid_types)
{
- if (strpos(", $valid_types,", ", $this->data_type,") !== False)
+ if (mb_strpos(", $valid_types,", ", $this->data_type,") !== False)
return TRUE;
$this->PrintError("Data type '$this->data_type' is not valid for '$this->plot_type' plots."
Modified: trunk/includes/smtp.php
===================================================================
--- trunk/includes/smtp.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/includes/smtp.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -336,7 +336,7 @@
$loops = 0;
if(is_resource($this->connection)){
- while((strpos($return, CRLF) === FALSE OR substr($line,3,1) !== ' ') AND $loops < 100){
+ while((mb_strpos($return, CRLF) === FALSE OR substr($line,3,1) !== ' ') AND $loops < 100){
$line = fgets($this->connection, 512);
$return .= $line;
$loops++;
Modified: trunk/includes/tcpdf/CHANGELOG.TXT
===================================================================
--- trunk/includes/tcpdf/CHANGELOG.TXT 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/includes/tcpdf/CHANGELOG.TXT 2011-07-03 03:27:48 UTC (rev 4620)
@@ -798,7 +798,7 @@
- The following Unicode to CID-0 tables were added on fonts folder: uni2cid_ak12.php, uni2cid_aj16.php, uni2cid_ag15.php, uni2cid_ac15.php.
4.0.024 (2008-09-12)
- - "stripos" function was replaced with "strpos + strtolower" for backward compatibility with PHP4.
+ - "stripos" function was replaced with "mb_strpos + strtolower" for backward compatibility with PHP4.
- support for Spot Colors were added. Check the new example n. 37 and the following new functions:
AddSpotColor()
SetDrawSpotColor()
Modified: trunk/includes/tcpdf/barcodes.php
===================================================================
--- trunk/includes/tcpdf/barcodes.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/includes/tcpdf/barcodes.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -948,7 +948,7 @@
$sum = $startid;
$clen = mb_strlen($code);
for ($i = 0; $i < $clen; ++$i) {
- $sum += (strpos($keys, $code{$i}) * ($i+1));
+ $sum += (mb_strpos($keys, $code{$i}) * ($i+1));
}
$check = ($sum % 103);
// add start, check and stop codes
@@ -957,7 +957,7 @@
$k = 0;
$len = mb_strlen($code);
for ($i = 0; $i < $len; ++$i) {
- $ck = strpos($keys, $code{$i});
+ $ck = mb_strpos($keys, $code{$i});
if (($i == 0) OR ($i > ($len-4))) {
$char_num = ord($code{$i});
$seq = $chr[$char_num];
Modified: trunk/includes/tcpdf/tcpdf.php
===================================================================
--- trunk/includes/tcpdf/tcpdf.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/includes/tcpdf/tcpdf.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -3277,23 +3277,23 @@
$tempstyle = strtoupper($style);
$style = '';
// underline
- if (strpos($tempstyle, 'U') !== false) {
+ if (mb_strpos($tempstyle, 'U') !== false) {
$this->underline = true;
} else {
$this->underline = false;
}
// line through (deleted)
- if (strpos($tempstyle, 'D') !== false) {
+ if (mb_strpos($tempstyle, 'D') !== false) {
$this->linethrough = true;
} else {
$this->linethrough = false;
}
// bold
- if (strpos($tempstyle, 'B') !== false) {
+ if (mb_strpos($tempstyle, 'B') !== false) {
$style .= 'B';
}
// oblique
- if (strpos($tempstyle, 'I') !== false) {
+ if (mb_strpos($tempstyle, 'I') !== false) {
$style .= 'I';
}
$bistyle = $style;
@@ -3392,7 +3392,7 @@
$styles = array('' => '', 'B' => ',Bold', 'I' => ',Italic', 'BI' => ',BoldItalic');
$sname = $name.$styles[$bistyle];
// artificial bold
- if (strpos($bistyle, 'B') !== false) {
+ if (mb_strpos($bistyle, 'B') !== false) {
if (isset($desc['StemV'])) {
$desc['StemV'] *= 2;
} else {
@@ -3400,7 +3400,7 @@
}
}
// artificial italic
- if (strpos($bistyle, 'I') !== false) {
+ if (mb_strpos($bistyle, 'I') !== false) {
if (isset($desc['ItalicAngle'])) {
$desc['ItalicAngle'] -= 11;
} else {
@@ -4022,7 +4022,7 @@
}
if (is_string($border)) {
$lm = ($this->LineWidth / 2);
- if (strpos($border,'L') !== false) {
+ if (mb_strpos($border,'L') !== false) {
if ($this->rtl) {
$xk = ($x - $w) * $k;
} else {
@@ -4030,7 +4030,7 @@
}
$s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $xk, (($this->h - $y + $lm) * $k), $xk, (($this->h - ($y + $h + $lm)) * $k));
}
- if (strpos($border,'T') !== false) {
+ if (mb_strpos($border,'T') !== false) {
if ($this->rtl) {
$xk = ($x - $w + $lm) * $k;
$xwk = ($x - $lm) * $k;
@@ -4040,7 +4040,7 @@
}
$s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $xk, (($this->h - $y) * $k), $xwk, (($this->h - $y) * $k));
}
- if (strpos($border,'R') !== false) {
+ if (mb_strpos($border,'R') !== false) {
if ($this->rtl) {
$xk = $x * $k;
} else {
@@ -4048,7 +4048,7 @@
}
$s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $xk, (($this->h - $y + $lm) * $k), $xk, (($this->h - ($y + $h + $lm))* $k));
}
- if (strpos($border,'B') !== false) {
+ if (mb_strpos($border,'B') !== false) {
if ($this->rtl) {
$xk = ($x - $w + $lm) * $k;
$xwk = ($x - $lm) * $k;
@@ -4459,16 +4459,16 @@
if ($border == 1) {
$cborder = 'LTR';
} else {
- if (!(false === strpos($border, 'L'))) {
+ if (!(false === mb_strpos($border, 'L'))) {
$cborder .= 'L';
}
- if (!(false === strpos($border, 'T'))) {
+ if (!(false === mb_strpos($border, 'T'))) {
$cborder .= 'T';
}
- if (!(false === strpos($border, 'R'))) {
+ if (!(false === mb_strpos($border, 'R'))) {
$cborder .= 'R';
}
- if ((!$this->opencell) AND (!(false === strpos($border, 'B')))) {
+ if ((!$this->opencell) AND (!(false === mb_strpos($border, 'B')))) {
$cborder .= 'B';
}
}
@@ -4478,16 +4478,16 @@
if ($border == 1) {
$cborder = 'LR';
} else {
- if (!(false === strpos($border, 'L'))) {
+ if (!(false === mb_strpos($border, 'L'))) {
$cborder .= 'L';
}
- if ((!$this->opencell) AND (!(false === strpos($border, 'T')))) {
+ if ((!$this->opencell) AND (!(false === mb_strpos($border, 'T')))) {
$cborder .= 'T';
}
- if (!(false === strpos($border, 'R'))) {
+ if (!(false === mb_strpos($border, 'R'))) {
$cborder .= 'R';
}
- if ((!$this->opencell) AND (!(false === strpos($border, 'B')))) {
+ if ((!$this->opencell) AND (!(false === mb_strpos($border, 'B')))) {
$cborder .= 'B';
}
}
@@ -4497,16 +4497,16 @@
if ($border == 1) {
$cborder = 'LRB';
} else {
- if (!(false === strpos($border, 'L'))) {
+ if (!(false === mb_strpos($border, 'L'))) {
$cborder .= 'L';
}
- if ((!$this->opencell) AND (!(false === strpos($border, 'T')))) {
+ if ((!$this->opencell) AND (!(false === mb_strpos($border, 'T')))) {
$cborder .= 'T';
}
- if (!(false === strpos($border, 'R'))) {
+ if (!(false === mb_strpos($border, 'R'))) {
$cborder .= 'R';
}
- if (!(false === strpos($border, 'B'))) {
+ if (!(false === mb_strpos($border, 'B'))) {
$cborder .= 'B';
}
}
@@ -5441,7 +5441,7 @@
} elseif ($ct == 2) {
$trns = array(ord(substr($t, 1, 1)), ord(substr($t, 3, 1)), ord(substr($t, 5, 1)));
} else {
- $pos = strpos($t, chr(0));
+ $pos = mb_strpos($t, chr(0));
if ($pos !== false) {
$trns = array($pos);
}
@@ -5743,7 +5743,7 @@
// define the ByteRange
$byte_range = array();
$byte_range[0] = 0;
- $byte_range[1] = strpos($pdfdoc, $this->byterange_string) + $byterange_string_len + 10;
+ $byte_range[1] = mb_strpos($pdfdoc, $this->byterange_string) + $byterange_string_len + 10;
$byte_range[2] = $byte_range[1] + $this->signature_max_length + 2;
$byte_range[3] = mb_strlen($pdfdoc) - $byte_range[2];
$pdfdoc = substr($pdfdoc, 0, $byte_range[1]).substr($pdfdoc, $byte_range[2]);
@@ -5772,7 +5772,7 @@
$signature = file_get_contents($tempsign, false, null, $pdfdoc_length);
unlink($tempsign);
// extract signature
- $signature = substr($signature, (strpos($signature, "%%EOF\n\n------") + 13));
+ $signature = substr($signature, (mb_strpos($signature, "%%EOF\n\n------") + 13));
$tmparr = explode("\n\n", $signature);
$signature = $tmparr[1];
unset($tmparr);
@@ -8249,7 +8249,7 @@
$returncolor = false;
$color = preg_replace('/[\s]*/', '', $color); // remove extra spaces
$color = strtolower($color);
- if (($dotpos = strpos($color, '.')) !== false) {
+ if (($dotpos = mb_strpos($color, '.')) !== false) {
// remove class parent (i.e.: color.red)
$color = substr($color, ($dotpos + 1));
}
@@ -9016,7 +9016,7 @@
* @see SetLineStyle()
*/
public function Rect($x, $y, $w, $h, $style='', $border_style=array(), $fill_color=array()) {
- if (!(false === strpos($style, 'F')) AND isset($fill_color)) {
+ if (!(false === mb_strpos($style, 'F')) AND isset($fill_color)) {
$this->SetFillColorArray($fill_color);
}
switch ($style) {
@@ -9114,7 +9114,7 @@
* @since 2.1.000 (2008-01-08)
*/
public function Curve($x0, $y0, $x1, $y1, $x2, $y2, $x3, $y3, $style='', $line_style=array(), $fill_color=array()) {
- if (!(false === strpos($style, 'F')) AND isset($fill_color)) {
+ if (!(false === mb_strpos($style, 'F')) AND isset($fill_color)) {
$this->SetFillColorArray($fill_color);
}
switch ($style) {
@@ -9171,7 +9171,7 @@
* @since 3.0008 (2008-05-12)
*/
public function Polycurve($x0, $y0, $segments, $style='', $line_style=array(), $fill_color=array()) {
- if (!(false === strpos($style, 'F')) AND isset($fill_color)) {
+ if (!(false === mb_strpos($style, 'F')) AND isset($fill_color)) {
$this->SetFillColorArray($fill_color);
}
switch ($style) {
@@ -9243,7 +9243,7 @@
return;
}
if ($rx) {
- if (!(false === strpos($style, 'F')) AND isset($fill_color)) {
+ if (!(false === mb_strpos($style, 'F')) AND isset($fill_color)) {
$this->SetFillColorArray($fill_color);
}
switch ($style) {
@@ -9404,7 +9404,7 @@
}
$nc += 4;
}
- if (!(false === strpos($style, 'F')) AND isset($fill_color)) {
+ if (!(false === mb_strpos($style, 'F')) AND isset($fill_color)) {
$this->SetFillColorArray($fill_color);
}
switch ($style) {
@@ -9623,7 +9623,7 @@
if ('0000' == $round_corner) { // Not rounded
$this->Rect($x, $y, $w, $h, $style, $border_style, $fill_color);
} else { // Rounded
- if (!(false === strpos($style, 'F')) AND isset($fill_color)) {
+ if (!(false === mb_strpos($style, 'F')) AND isset($fill_color)) {
$this->SetFillColorArray($fill_color);
}
switch ($style) {
@@ -10495,7 +10495,7 @@
if (empty($this->javascript) AND empty($this->js_objects)) {
return;
}
- if (strpos($this->javascript, 'this.addField') > 0) {
+ if (mb_strpos($this->javascript, 'this.addField') > 0) {
if (!$this->ur) {
//$this->setUserRights();
}
@@ -12542,7 +12542,7 @@
preg_match("/%%Creator:([^\r\n]+)/", $data, $regs); # find Creator
if (count($regs) > 1) {
$version_str = trim($regs[1]); # e.g. "Adobe Illustrator(R) 8.0"
- if (strpos($version_str, 'Adobe Illustrator') !== false) {
+ if (mb_strpos($version_str, 'Adobe Illustrator') !== false) {
$versexp = explode(' ', $version_str);
$version = (float)array_pop($versexp);
if ($version >= 9) {
@@ -12551,7 +12551,7 @@
}
}
// strip binary bytes in front of PS-header
- $start = strpos($data, '%!PS-Adobe');
+ $start = mb_strpos($data, '%!PS-Adobe');
if ($start > 0) {
$data = substr($data, $start);
}
@@ -12562,17 +12562,17 @@
} else {
$this->Error('No BoundingBox found in EPS file: '.$file);
}
- $start = strpos($data, '%%EndSetup');
+ $start = mb_strpos($data, '%%EndSetup');
if ($start === false) {
- $start = strpos($data, '%%EndProlog');
+ $start = mb_strpos($data, '%%EndProlog');
}
if ($start === false) {
- $start = strpos($data, '%%BoundingBox');
+ $start = mb_strpos($data, '%%BoundingBox');
}
$data = substr($data, $start);
- $end = strpos($data, '%%PageTrailer');
+ $end = mb_strpos($data, '%%PageTrailer');
if ($end===false) {
- $end = strpos($data, 'showpage');
+ $end = mb_strpos($data, 'showpage');
}
if ($end) {
$data = substr($data, 0, $end);
@@ -13350,7 +13350,7 @@
$repTable = array("\t" => ' ', "\0" => ' ', "\x0B" => ' ', "\\" => "\\\\");
$html = strtr($html, $repTable);
$offset = 0;
- while (($offset < mb_strlen($html)) AND ($pos = strpos($html, '</pre>', $offset)) !== false) {
+ while (($offset < mb_strlen($html)) AND ($pos = mb_strpos($html, '</pre>', $offset)) !== false) {
$html_a = substr($html, 0, $offset);
$html_b = substr($html, $offset, ($pos - $offset + 6));
while (preg_match("'<xre([^\>]*)>(.*?)\n(.*?)</pre>'si", $html_b)) {
@@ -13361,7 +13361,7 @@
$offset = mb_strlen($html_a.$html_b);
}
$offset = 0;
- while (($offset < mb_strlen($html)) AND ($pos = strpos($html, '</textarea>', $offset)) !== false) {
+ while (($offset < mb_strlen($html)) AND ($pos = mb_strpos($html, '</textarea>', $offset)) !== false) {
$html_a = substr($html, 0, $offset);
$html_b = substr($html, $offset, ($pos - $offset + 11));
while (preg_match("'<textarea([^\>]*)>(.*?)\n(.*?)</textarea>'si", $html_b)) {
@@ -13375,7 +13375,7 @@
$html = preg_replace("'([\s]*)<option'si", "<option", $html);
$html = preg_replace("'</option>([\s]*)'si", "</option>", $html);
$offset = 0;
- while (($offset < mb_strlen($html)) AND ($pos = strpos($html, '</option>', $offset)) !== false) {
+ while (($offset < mb_strlen($html)) AND ($pos = mb_strpos($html, '</option>', $offset)) !== false) {
$html_a = substr($html, 0, $offset);
$html_b = substr($html, $offset, ($pos - $offset + 9));
while (preg_match("'<option([^\>]*)>(.*?)</option>'si", $html_b)) {
@@ -14300,7 +14300,7 @@
}
} elseif (($plalign == 'R') AND (!$this->rtl)) {
// right alignment on LTR document
- if (intval($this->revstrpos($pmid, ')]')) == (intval($this->revstrpos($pmid, ' )]')) + 1)) {
+ if (intval($this->revmb_strpos($pmid, ')]')) == (intval($this->revmb_strpos($pmid, ' )]')) + 1)) {
// remove last space (if any)
$linew -= $one_space_width;
$mdiff = abs($tw - $linew);
@@ -14308,11 +14308,11 @@
$t_x = $mdiff;
} elseif (($plalign == 'L') AND ($this->rtl)) {
// left alignment on RTL document
- if ((intval($this->revstrpos($pmid, '[( ')) == intval($this->revstrpos($pmid, '[('))) OR (intval($this->revstrpos($pmid, '[('.chr(0).chr(32))) == intval($this->revstrpos($pmid, '[(')))) {
+ if ((intval($this->revmb_strpos($pmid, '[( ')) == intval($this->revmb_strpos($pmid, '[('))) OR (intval($this->revmb_strpos($pmid, '[('.chr(0).chr(32))) == intval($this->revmb_strpos($pmid, '[(')))) {
// remove first space (if any)
$linew -= $one_space_width;
}
- if (intval(strpos($pmid, '[(')) == (intval($this->revstrpos($pmid, '[(')))) {
+ if (intval(mb_strpos($pmid, '[(')) == (intval($this->revmb_strpos($pmid, '[(')))) {
// remove last space (if any)
$linew -= $one_space_width;
if (($this->CurrentFont['type'] == 'TrueTypeUnicode') OR ($this->CurrentFont['type'] == 'cidfont0')) {
@@ -14378,12 +14378,12 @@
global $spacew;
while (preg_match('/([0-9\.\+\-]*)[\s](Td|cm|m|l|c|re)[\s]/x', $pmid, $strpiece, PREG_OFFSET_CAPTURE, $offset) == 1) {
// check if we are inside a string section '[( ... )]'
- $stroffset = strpos($pmid, '[(', $offset);
+ $stroffset = mb_strpos($pmid, '[(', $offset);
if (($stroffset !== false) AND ($stroffset <= $strpiece[2][1])) {
// set offset to the end of string section
- $offset = strpos($pmid, ')]', $stroffset);
+ $offset = mb_strpos($pmid, ')]', $stroffset);
while (($offset !== false) AND ($pmid{($offset - 1)} == '\\')) {
- $offset = strpos($pmid, ')]', ($offset + 1));
+ $offset = mb_strpos($pmid, ')]', ($offset + 1));
}
if ($offset === false) {
$this->Error('HTML Justification: malformed PDF code.');
@@ -14396,13 +14396,13 @@
$spacew = ($spacewidth * $ns);
}
$offset = $strpiece[2][1] + mb_strlen($strpiece[2][0]);
- $epsposbeg = strpos($pmid, 'q'.$this->epsmarker, $offset);
- $epsposend = strpos($pmid, $this->epsmarker.'Q', $offset) + mb_strlen($this->epsmarker.'Q');
+ $epsposbeg = mb_strpos($pmid, 'q'.$this->epsmarker, $offset);
+ $epsposend = mb_strpos($pmid, $this->epsmarker.'Q', $offset) + mb_strlen($this->epsmarker.'Q');
if ((($epsposbeg > 0) AND ($epsposend > 0) AND ($offset > $epsposbeg) AND ($offset < $epsposend))
OR (($epsposbeg === false) AND ($epsposend > 0) AND ($offset < $epsposend))) {
// shift EPS images
$trx = sprintf('1 0 0 1 %.3F 0 cm', $spacew);
- $epsposbeg = strpos($pmid, 'q'.$this->epsmarker, ($prev_epsposbeg - 6));
+ $epsposbeg = mb_strpos($pmid, 'q'.$this->epsmarker, ($prev_epsposbeg - 6));
$pmid_b = substr($pmid, 0, $epsposbeg);
$pmid_m = substr($pmid, $epsposbeg, ($epsposend - $epsposbeg));
$pmid_e = substr($pmid, $epsposend);
@@ -14971,7 +14971,7 @@
}
} elseif (($plalign == 'R') AND (!$this->rtl)) {
// right alignment on LTR document
- if (intval($this->revstrpos($pmid, ')]')) == (intval($this->revstrpos($pmid, ' )]')) + 1)) {
+ if (intval($this->revmb_strpos($pmid, ')]')) == (intval($this->revmb_strpos($pmid, ' )]')) + 1)) {
// remove last space (if any)
$linew -= $one_space_width;
$mdiff = abs($tw - $linew);
@@ -14979,11 +14979,11 @@
$t_x = $mdiff;
} elseif (($plalign == 'L') AND ($this->rtl)) {
// left alignment on RTL document
- if ((intval($this->revstrpos($pmid, '[( ')) == intval($this->revstrpos($pmid, '[('))) OR (intval($this->revstrpos($pmid, '[('.chr(0).chr(32))) == intval($this->revstrpos($pmid, '[(')))) {
+ if ((intval($this->revmb_strpos($pmid, '[( ')) == intval($this->revmb_strpos($pmid, '[('))) OR (intval($this->revmb_strpos($pmid, '[('.chr(0).chr(32))) == intval($this->revmb_strpos($pmid, '[(')))) {
// remove first space (if any)
$linew -= $one_space_width;
}
- if (intval(strpos($pmid, '[(')) == (intval($this->revstrpos($pmid, '[(')))) {
+ if (intval(mb_strpos($pmid, '[(')) == (intval($this->revmb_strpos($pmid, '[(')))) {
// remove last space (if any)
$linew -= $one_space_width;
if (($this->CurrentFont['type'] == 'TrueTypeUnicode') OR ($this->CurrentFont['type'] == 'cidfont0')) {
@@ -15574,7 +15574,7 @@
$options = explode ("\r", $tag['attribute']['opt']);
$values = array();
foreach ($options as $val) {
- if (strpos($val, "\t") !== false) {
+ if (mb_strpos($val, "\t") !== false) {
$opts = explode("\t", $val);
$values[] = $opts;
$w = max($w, $this->GetStringWidth($opts[1]));
@@ -17276,10 +17276,10 @@
* @access public
* @since 4.8.038 (2010-03-13)
*/
- public function revstrpos($haystack, $needle, $offset = 0) {
+ public function revmb_strpos($haystack, $needle, $offset = 0) {
$length = mb_strlen($haystack);
$offset = ($offset > 0)?($length - $offset):abs($offset);
- $pos = strpos(strrev($haystack), strrev($needle), $offset);
+ $pos = mb_strpos(strrev($haystack), strrev($needle), $offset);
return ($pos === false)?false:($length - $pos - mb_strlen($needle));
}
Modified: trunk/install/save.php
===================================================================
--- trunk/install/save.php 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/install/save.php 2011-07-03 03:27:48 UTC (rev 4620)
@@ -361,7 +361,7 @@
if (substr($SQLScriptFile[$i],0,8) == 'LANGUAGE'){
$InAFunction = false;
}
- if (strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){
+ if (mb_strpos($SQLScriptFile[$i],';')>0 AND ! $InAFunction){
// Database created above with correct name.
if (strncasecmp($SQL, ' CREATE DATABASE ', 17)
AND strncasecmp($SQL, ' USE ', 5)){
Modified: trunk/reportwriter/WriteReport.inc
===================================================================
--- trunk/reportwriter/WriteReport.inc 2011-07-03 03:01:39 UTC (rev 4619)
+++ trunk/reportwriter/WriteReport.inc 2011-07-03 03:27:48 UTC (rev 4620)
@@ -544,7 +544,7 @@
$CSVOutput = '';
// Write the column headings
foreach ($Heading as $mycolumn) { // check for embedded commas and enclose in quotes
- if (strpos($mycolumn,',')===false) $CSVOutput .= $mycolumn.','; else $CSVOutput .= '"'.$mycolumn.'",';
+ if (mb_strpos($mycolumn,',')===false) $CSVOutput .= $mycolumn.','; else $CSVOutput .= '"'.$mycolumn.'",';
}
$CSVOutput = substr($CSVOutput,0,-1).chr(10); // Strip the last comma off and add line feed
// Now write each data line and totals
@@ -561,7 +561,7 @@
default:
$CSVLine = '';
foreach ($myrow as $mycolumn) { // check for embedded commas and enclose in quotes
- if (strpos($mycolumn,',')===false) $CSVLine .= $mycolumn.','; else $CSVLine .= '"'.$mycolumn.'",';
+ if (mb_strpos($mycolumn,',')===false) $CSVLine .= $mycolumn.','; else $CSVLine .= '"'.$mycolumn.'",';
}
$CSVLine = substr($CSVLine,0,-1); // Strip ...
[truncated message content] |