|
From: <dai...@us...> - 2011-07-03 03:36:00
|
Revision: 4621
http://web-erp.svn.sourceforge.net/web-erp/?rev=4621&view=rev
Author: daintree
Date: 2011-07-03 03:35:49 +0000 (Sun, 03 Jul 2011)
Log Message:
-----------
substr to mb_substr
Modified Paths:
--------------
trunk/ConfirmDispatch_Invoice.php
trunk/ContractBOM.php
trunk/Contracts.php
trunk/CounterSales.php
trunk/CustomerBranches.php
trunk/Customers.php
trunk/DailySalesInquiry.php
trunk/EDIProcessOrders.php
trunk/FixedAssetItems.php
trunk/FixedAssetTransfer.php
trunk/FormDesigner.php
trunk/GetStockImage.php
trunk/Numbers/Words/lang.bg.php
trunk/Numbers/Words/lang.cs.php
trunk/Numbers/Words/lang.de.php
trunk/Numbers/Words/lang.dk.php
trunk/Numbers/Words/lang.en_100.php
trunk/Numbers/Words/lang.en_GB.php
trunk/Numbers/Words/lang.en_US.php
trunk/Numbers/Words/lang.es.php
trunk/Numbers/Words/lang.es_AR.php
trunk/Numbers/Words/lang.et.php
trunk/Numbers/Words/lang.fr.php
trunk/Numbers/Words/lang.fr_BE.php
trunk/Numbers/Words/lang.he.php
trunk/Numbers/Words/lang.hu_HU.php
trunk/Numbers/Words/lang.id.php
trunk/Numbers/Words/lang.it_IT.php
trunk/Numbers/Words/lang.lt.php
trunk/Numbers/Words/lang.nl.php
trunk/Numbers/Words/lang.pl.php
trunk/Numbers/Words/lang.pt_BR.php
trunk/Numbers/Words/lang.ru.php
trunk/Numbers/Words/lang.sv.php
trunk/Numbers/Words.php
trunk/OffersReceived.php
trunk/PO_AuthoriseMyOrders.php
trunk/PO_Items.php
trunk/PageSecurity.php
trunk/SalesCategories.php
trunk/SelectCreditItems.php
trunk/SelectOrderItems.php
trunk/SpecialOrder.php
trunk/Stocks.php
trunk/SupplierCredit.php
trunk/SupplierInvoice.php
trunk/SupplierTenders.php
trunk/Suppliers.php
trunk/UpgradeDatabase.php
trunk/WorkOrderReceive.php
trunk/Z_ImportChartOfAccounts.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_poAddLanguage.php
trunk/Z_poEditLangModule.php
trunk/Z_poEditLangRemaining.php
trunk/api/api_branches.php
trunk/api/api_customers.php
trunk/api/api_debtortransactions.php
trunk/api/api_glaccounts.php
trunk/api/api_glgroups.php
trunk/api/api_glsections.php
trunk/api/api_locations.php
trunk/api/api_purchdata.php
trunk/api/api_salesareas.php
trunk/api/api_salesman.php
trunk/api/api_salesorders.php
trunk/api/api_salestypes.php
trunk/api/api_stock.php
trunk/api/api_stockcategories.php
trunk/api/api_suppliers.php
trunk/api/api_workorders.php
trunk/config.distrib.php
trunk/doc/Change.log
trunk/doc/Manual/ManualAPIFunctions.php
trunk/includes/ConstructSQLForUserDefinedSalesReport.inc
trunk/includes/DateFunctions.inc
trunk/includes/DefineCartClass.php
trunk/includes/EDIVariableSubstitution.inc
trunk/includes/EDIconfig.inc
trunk/includes/FreightCalculation.inc
trunk/includes/LanguageSetup.php
trunk/includes/MiscFunctions.php
trunk/includes/PDFSalesAnalysis.inc
trunk/includes/RFC822.php
trunk/includes/class.pdf.php
trunk/includes/header.inc
trunk/includes/htmlMimeMail.php
trunk/includes/mimePart.php
trunk/includes/php-gettext/gettext.inc
trunk/includes/php-gettext/streams.php
trunk/includes/phplot/ChangeLog
trunk/includes/phplot/NEWS.txt
trunk/includes/phplot/contrib/color_range.test1.php
trunk/includes/phplot/contrib/prune_labels.test.php
trunk/includes/phplot/phplot.php
trunk/includes/smtp.php
trunk/includes/tcpdf/barcodes.php
trunk/includes/tcpdf/config/tcpdf_config.php
trunk/includes/tcpdf/config/tcpdf_config_alt.php
trunk/includes/tcpdf/tcpdf.php
trunk/install/index.php
trunk/install/save.php
trunk/javascripts/MiscFunctions.js
trunk/reportwriter/FormMaker.php
trunk/reportwriter/ReportMaker.php
trunk/reportwriter/WriteForm.inc
trunk/reportwriter/WriteReport.inc
trunk/reportwriter/admin/RCFunctions.inc
trunk/reportwriter/admin/forms/ReportsCritSetup.html
Modified: trunk/ConfirmDispatch_Invoice.php
===================================================================
--- trunk/ConfirmDispatch_Invoice.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/ConfirmDispatch_Invoice.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -577,7 +577,7 @@
$ErrMsg = _('Could not retrieve the quantity left at the location once this order is invoiced (for the purposes of checking that stock will not go negative because)');
$Result = DB_query($SQL,$db,$ErrMsg);
$CheckNegRow = DB_fetch_array($Result);
- if (($CheckNegRow['mbflag']=='B' OR $CheckNegRow['mbflag']=='M') AND substr($OrderLine->StockID,0,4)!='ASSET'){
+ if (($CheckNegRow['mbflag']=='B' OR $CheckNegRow['mbflag']=='M') AND mb_substr($OrderLine->StockID,0,4)!='ASSET'){
if ($CheckNegRow['quantity'] < $OrderLine->QtyDispatched){
prnMsg( _('Invoicing the selected order would result in negative stock. The system parameters are set to prohibit negative stocks from occurring. This invoice cannot be created until the stock on hand is corrected.'),'error',$OrderLine->StockID . ' ' . $CheckNegRow['description'] . ' - ' . _('Negative Stock Prohibited'));
$NegativesFound = true;
@@ -798,13 +798,13 @@
foreach ($_SESSION['Items']->LineItems as $OrderLine) {
/*Test to see if the item being sold is an asset */
- if (substr($OrderLine->StockID,0,6)=='ASSET-'){
+ if (mb_substr($OrderLine->StockID,0,6)=='ASSET-'){
$IsAsset = true;
$HyphenOccursAt = mb_strpos($OrderLine->StockID,'-',6);
if ($HyphenOccursAt == false){
- $AssetNumber = intval(substr($OrderLine->StockID,6));
+ $AssetNumber = intval(mb_substr($OrderLine->StockID,6));
} else {
- $AssetNumber = intval(substr($OrderLine->StockID,6,mb_strlen($OrderLine->StockID)-$HyphenOccursAt-1));
+ $AssetNumber = intval(mb_substr($OrderLine->StockID,6,mb_strlen($OrderLine->StockID)-$HyphenOccursAt-1));
}
prnMsg (_('The asset number beind disposed of is:') . ' ' . $AssetNumber, 'info');
} else {
Modified: trunk/ContractBOM.php
===================================================================
--- trunk/ContractBOM.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/ContractBOM.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -165,8 +165,8 @@
if (isset($_POST['NewItem'])){ /* NewItem is set from the part selection list as the part code selected */
/* take the form entries and enter the data from the form into the PurchOrder class variable */
foreach ($_POST as $ItemCode => $Quantity) {
- if (substr($ItemCode, 0, 3)=='Qty') {
- $ItemCode=substr($ItemCode, 3, mb_strlen($ItemCode)-3);
+ if (mb_substr($ItemCode, 0, 3)=='Qty') {
+ $ItemCode=mb_substr($ItemCode, 3, mb_strlen($ItemCode)-3);
$AlreadyOnThisBOM = 0;
if (count($_SESSION['Contract'.$identifier]->ContractBOM)!=0){
Modified: trunk/Contracts.php
===================================================================
--- trunk/Contracts.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Contracts.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -107,7 +107,7 @@
$filename = $_SESSION['part_pics_dir'] . '/' . $_SESSION['Contract'.$identifier]->ContractRef . '.jpg';
//But check for the worst
- if (strtoupper(substr(trim($_FILES['Drawing']['name']),mb_strlen($_FILES['Drawing']['name'])-3))!='JPG'){
+ if (strtoupper(mb_substr(trim($_FILES['Drawing']['name']),mb_strlen($_FILES['Drawing']['name'])-3))!='JPG'){
prnMsg(_('Only jpg files are supported - a file extension of .jpg is expected'),'warn');
$UploadTheFile ='No';
} elseif ( $_FILES['Drawing']['size'] > ($_SESSION['MaxImageSize']*1024)) { //File Size Check
Modified: trunk/CounterSales.php
===================================================================
--- trunk/CounterSales.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/CounterSales.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -36,7 +36,7 @@
if (isset($_POST['OrderItems'])){
foreach ($_POST as $key => $value) {
if (strstr($key,'itm')) {
- $NewItemArray[substr($key,3)] = trim($value);
+ $NewItemArray[mb_substr($key,3)] = trim($value);
}
}
}
Modified: trunk/CustomerBranches.php
===================================================================
--- trunk/CustomerBranches.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/CustomerBranches.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -443,7 +443,7 @@
$result = DB_query($sql,$db);
$myrow = DB_fetch_row($result);
echo '<div class="page_help_text">'._('No Branches are defined for').' - '.$myrow[0]. '. ' . _('You must have a minimum of one branch for each Customer. Please add a branch now.') .'</div>';
- $_POST['BranchCode'] = substr($DebtorNo,0,10);
+ $_POST['BranchCode'] = mb_substr($DebtorNo,0,10);
$_POST['BrName'] = $myrow[0];
$_POST['BrAddress1'] = $myrow[1];
$_POST['BrAddress2'] = $myrow[2];
Modified: trunk/Customers.php
===================================================================
--- trunk/Customers.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Customers.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -280,7 +280,7 @@
$ErrMsg = _('This customer could not be added because');
$result = DB_query($sql,$db,$ErrMsg);
- $BranchCode = substr($_POST['DebtorNo'],0,4);
+ $BranchCode = mb_substr($_POST['DebtorNo'],0,4);
echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath .'/CustomerBranches.php?DebtorNo=' . $_POST['DebtorNo'] . '">';
Modified: trunk/DailySalesInquiry.php
===================================================================
--- trunk/DailySalesInquiry.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/DailySalesInquiry.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -68,7 +68,7 @@
}
if (mb_strlen($Date_Array[2])>4) {
- $Date_Array[2]= substr($Date_Array[2],0,2);
+ $Date_Array[2]= mb_substr($Date_Array[2],0,2);
}
$StartDateSQL = date('Y-m-d', mktime(0,0,0, (int)$Date_Array[1],1,(int)$Date_Array[0]));
Modified: trunk/EDIProcessOrders.php
===================================================================
--- trunk/EDIProcessOrders.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/EDIProcessOrders.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -78,9 +78,9 @@
$LineText = StripTrailingComma($LineText);
echo "<br />".$LineText;
- if ($SegTag != substr($LineText,0,3)){
+ if ($SegTag != mb_substr($LineText,0,3)){
$SegCounter=1;
- $SegTag = substr($LineText,0,3);
+ $SegTag = mb_substr($LineText,0,3);
} else {
$SegCounter++;
if ($SegCounter > $Seg[$SegID]['MaxOccur']){
@@ -119,17 +119,17 @@
echo '<br />' . _('The segment tag') . ' ' . $SegTag . ' ' . _('is being processed');
switch ($SegTag){
case 'UNH':
- $UNH_elements = explode ('+',substr($LineText,4));
+ $UNH_elements = explode ('+',mb_substr($LineText,4));
$Order->Comments .= _('Customer EDI Ref') . ': ' . $UNH_elements[0];
$EmailText .= "\n" . _('EDI Message Ref') . ': ' . $UNH_elements[0];
- if (substr($UNH_elements[1],0,6)!='ORDERS'){
+ if (mb_substr($UNH_elements[1],0,6)!='ORDERS'){
$EmailText .= "\n" . _('This message is not an order');
$TryNextFile = True;
}
break;
case 'BGM':
- $BGM_elements = explode('+',substr($LineText,4));
+ $BGM_elements = explode('+',mb_substr($LineText,4));
$BGM_C002 = explode(':',$BGM_elements[0]);
switch ($BGM_C002[0]){
case '220':
@@ -239,7 +239,7 @@
break;
case 'DTM':
/*explode into an arrage all items delimited by the : - only after the + */
- $DTM_C507 = explode(':',substr($LineText,4));
+ $DTM_C507 = explode(':',mb_substr($LineText,4));
$LocalFormatDate = ConvertEDIDate($DTM_C507[1],$DTM_C507[2]);
switch ($DTM_C507[0]){
@@ -294,7 +294,7 @@
break;
case 'PAI':
/*explode into an array all items delimited by the : - only after the + */
- $PAI_C534 = explode(':',substr($LineText,4));
+ $PAI_C534 = explode(':',mb_substr($LineText,4));
if ($PAI_C534[0]=='1'){
$EmailText .= "\n" . _('Payment will be effected by a direct payment for this order');
} elseif($PAI_C534[0]=='OA'){
@@ -318,7 +318,7 @@
}
break;
case 'ALI':
- $ALI = explode('+',substr($LineText,4));
+ $ALI = explode('+',mb_substr($LineText,4));
if (mb_strlen($ALI[0])>1){
$EmailText .= "\n" . _('Goods of origin') . ' ' . $ALI[0];
}
@@ -347,7 +347,7 @@
}
break;
case 'FTX':
- $FTX = explode('+',substr($LineText,4));
+ $FTX = explode('+',mb_substr($LineText,4));
/*agreed coded text is not catered for ... yet
only free form text */
if (mb_strlen($FTX[3])>5){
@@ -357,7 +357,7 @@
}
break;
case 'RFF':
- $RFF = explode(':',substr($LineText,4));
+ $RFF = explode(':',mb_substr($LineText,4));
switch ($RFF[0]){
case 'AE':
$MsgText = "\n" . _('Authorisation for expense no') . ' ' . $RFF[1];
@@ -404,7 +404,7 @@
$EmailText .= $MsgText;
break;
case 'NAD':
- $NAD = explode('+',substr($LineText,4));
+ $NAD = explode('+',mb_substr($LineText,4));
$NAD_C082 = explode(':', $NAD[1]);
$NAD_C058 = explode(':', $NAD[2]); /*Not used according to MIG */
$NAD_C080 = explode(':', $NAD[3]);
@@ -561,7 +561,7 @@
function StripTrailingComma ($StringToStrip){
if (strrpos($StringToStrip,"'")){
- Return substr($StringToStrip,0,strrpos($StringToStrip,"'"));
+ Return mb_substr($StringToStrip,0,strrpos($StringToStrip,"'"));
} else {
Return $StringToStrip;
}
Modified: trunk/FixedAssetItems.php
===================================================================
--- trunk/FixedAssetItems.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/FixedAssetItems.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -30,7 +30,7 @@
$filename = $_SESSION['part_pics_dir'] . '/ASSET_' . $AssetID . '.jpg';
//But check for the worst
- if (strtoupper(substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){
+ if (strtoupper(mb_substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){
prnMsg(_('Only jpg files are supported - a file extension of .jpg is expected'),'warn');
$UploadTheFile ='No';
} elseif ( $_FILES['ItemPicture']['size'] > ($_SESSION['MaxImageSize']*1024)) { //File Size Check
Modified: trunk/FixedAssetTransfer.php
===================================================================
--- trunk/FixedAssetTransfer.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/FixedAssetTransfer.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -9,8 +9,8 @@
include('includes/header.inc');
foreach ($_POST as $AssetToMove => $Value) { //Value is not used?
- if (substr($AssetToMove,0,4)=='Move') { // the form variable is of the format MoveAssetID so need to strip the move bit off
- $AssetID=substr($AssetToMove,4);
+ if (mb_substr($AssetToMove,0,4)=='Move') { // the form variable is of the format MoveAssetID so need to strip the move bit off
+ $AssetID=mb_substr($AssetToMove,4);
$sql="UPDATE fixedassets
SET assetlocation='".$_POST['Location'.$AssetID] ."'
WHERE assetid='". $AssetID . "'";
Modified: trunk/FormDesigner.php
===================================================================
--- trunk/FormDesigner.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/FormDesigner.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -78,8 +78,8 @@
/*First create a simple xml object from the main file */
$FormDesign = simplexml_load_file($PathPrefix.'companies/'.$_SESSION['DatabaseName'].'/FormDesigns/'.$_POST['FormName']);
$FormDesign['name']=$_POST['formname'];
- if (substr($_POST['PaperSize'],-8)=='Portrait') {
- $_POST['PaperSize']=substr($_POST['PaperSize'],0,mb_strlen($_POST['PaperSize'])-9);
+ if (mb_substr($_POST['PaperSize'],-8)=='Portrait') {
+ $_POST['PaperSize']=mb_substr($_POST['PaperSize'],0,mb_strlen($_POST['PaperSize'])-9);
}
$FormDesign->PaperSize=$_POST['PaperSize'];
$FormDesign->LineHeight=$_POST['LineHeight'];
@@ -164,8 +164,8 @@
/* Select the paper size/orientation */
echo '<th width=33%>'._('Paper Size').'<select name="PaperSize">';
foreach ($Papers as $Paper) {
- if (substr($Paper,-8)=='Portrait') {
- $PaperValue=substr($Paper,0,mb_strlen($Paper)-9);
+ if (mb_substr($Paper,-8)=='Portrait') {
+ $PaperValue=mb_substr($Paper,0,mb_strlen($Paper)-9);
} else {
$PaperValue=$Paper;
}
Modified: trunk/GetStockImage.php
===================================================================
--- trunk/GetStockImage.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/GetStockImage.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -22,26 +22,26 @@
// Color decode function
function DecodeBgColor( $colorstr ) {
if ( $colorstr[0] == '#' ) {
- $colorstr = substr($colorstr,1,mb_strlen($colorstr));
+ $colorstr = mb_substr($colorstr,1,mb_strlen($colorstr));
}
$red = 0;
if(mb_strlen($colorstr) > 1) {
- $red = hexdec(substr($colorstr,0,2));
- $colorstr = substr($colorstr,2,mb_strlen($colorstr));
+ $red = hexdec(mb_substr($colorstr,0,2));
+ $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr));
}
$green = 0;
if(mb_strlen($colorstr) > 1) {
- $green = hexdec(substr($colorstr,0,2));
- $colorstr = substr($colorstr,2,mb_strlen($colorstr));
+ $green = hexdec(mb_substr($colorstr,0,2));
+ $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr));
}
$blue = 0;
if(mb_strlen($colorstr) > 1) {
- $blue = hexdec(substr($colorstr,0,2));
- $colorstr = substr($colorstr,2,mb_strlen($colorstr));
+ $blue = hexdec(mb_substr($colorstr,0,2));
+ $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr));
}
if(mb_strlen($colorstr) > 1) {
- $alpha = hexdec(substr($colorstr,0,2));
- $colorstr = substr($colorstr,2,mb_strlen($colorstr));
+ $alpha = hexdec(mb_substr($colorstr,0,2));
+ $colorstr = mb_substr($colorstr,2,mb_strlen($colorstr));
}
if ( isset($alpha) )
return array('red' => $red, 'green' => $green, 'blue' => $blue, 'alpha' => $alpha );
@@ -120,8 +120,8 @@
if( $i === false )
$type = 'png';
else {
- $type = strtolower(substr($stockid,$i+1,mb_strlen($stockid)));
- $stockid = substr($stockid,0,$i);
+ $type = strtolower(mb_substr($stockid,$i+1,mb_strlen($stockid)));
+ $stockid = mb_substr($stockid,0,$i);
if($blanktext && !isset($text))
$text = '';
}
Modified: trunk/Numbers/Words/lang.bg.php
===================================================================
--- trunk/Numbers/Words/lang.bg.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.bg.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -311,8 +311,8 @@
if (is_string($num)) {
$ret = array();
$mb_strlen = mb_strlen($num);
- $first = substr($num, 0, $mb_strlen%3);
- preg_match_all('/\d{3}/', substr($num, $mb_strlen%3, $mb_strlen), $m);
+ $first = mb_substr($num, 0, $mb_strlen%3);
+ preg_match_all('/\d{3}/', mb_substr($num, $mb_strlen%3, $mb_strlen), $m);
$ret =& $m[0];
if ($first) array_unshift($ret, $first);
return $ret;
@@ -446,9 +446,9 @@
if (!$num || preg_match('/^-?0+$/', $num) || !preg_match('/^-?\d+$/', $num)) return $this->_zero;
// add a minus sign
- if (substr($num, 0, 1) == '-') {
+ if (mb_substr($num, 0, 1) == '-') {
$ret_minus = $this->_minus . $this->_sep;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
// if the absolute value is greater than 9.99*10^302, return infinity
Modified: trunk/Numbers/Words/lang.cs.php
===================================================================
--- trunk/Numbers/Words/lang.cs.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.cs.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -169,9 +169,9 @@
$ret = '';
// add a minus sign
- if (substr($num, 0, 1) == '-') {
+ if (mb_substr($num, 0, 1) == '-') {
$ret = $this->_sep . $this->_minus;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
// strip excessive zero signs and spaces
@@ -185,8 +185,8 @@
// check for highest power
if (isset($this->_exponent[$p])) {
- // send substr from $curp to $p
- $snum = substr($num, $maxp - $curp, $curp - $p + 1);
+ // send mb_substr from $curp to $p
+ $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1);
$snum = preg_replace('/^0+/','',$snum);
if ($snum !== '') {
$cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1];
@@ -198,7 +198,7 @@
continue;
}
}
- $num = substr($num, $maxp - $curp, $curp - $p + 1);
+ $num = mb_substr($num, $maxp - $curp, $curp - $p + 1);
if ($num == 0) {
return $ret;
}
@@ -210,13 +210,13 @@
switch(mb_strlen($num)) {
case 3:
- $h = (int)substr($num,-3,1);
+ $h = (int)mb_substr($num,-3,1);
case 2:
- $t = (int)substr($num,-2,1);
+ $t = (int)mb_substr($num,-2,1);
case 1:
- $d = (int)substr($num,-1,1);
+ $d = (int)mb_substr($num,-1,1);
break;
case 0:
Modified: trunk/Numbers/Words/lang.de.php
===================================================================
--- trunk/Numbers/Words/lang.de.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.de.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -158,9 +158,9 @@
$ret = '';
// add a minus sign
- if (substr($num, 0, 1) == '-') {
+ if (mb_substr($num, 0, 1) == '-') {
$ret = $this->_sep . $this->_minus;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
// strip excessive zero signs and spaces
@@ -174,8 +174,8 @@
// check for highest power
if (isset($this->_exponent[$p])) {
- // send substr from $curp to $p
- $snum = substr($num, $maxp - $curp, $curp - $p + 1);
+ // send mb_substr from $curp to $p
+ $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1);
$snum = preg_replace('/^0+/','',$snum);
if ($snum !== '') {
$cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1];
@@ -187,7 +187,7 @@
continue;
}
}
- $num = substr($num, $maxp - $curp, $curp - $p + 1);
+ $num = mb_substr($num, $maxp - $curp, $curp - $p + 1);
if ($num == 0) {
return $ret;
}
@@ -199,13 +199,13 @@
switch(mb_strlen($num)) {
case 3:
- $h = (int)substr($num,-3,1);
+ $h = (int)mb_substr($num,-3,1);
case 2:
- $t = (int)substr($num,-2,1);
+ $t = (int)mb_substr($num,-2,1);
case 1:
- $d = (int)substr($num,-1,1);
+ $d = (int)mb_substr($num,-1,1);
break;
case 0:
Modified: trunk/Numbers/Words/lang.dk.php
===================================================================
--- trunk/Numbers/Words/lang.dk.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.dk.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -172,9 +172,9 @@
$ret = '';
// add a minus sign
- if (substr($num, 0, 1) == '-') {
+ if (mb_substr($num, 0, 1) == '-') {
$ret = $this->_sep . $this->_minus;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
// strip excessive zero signs and spaces
@@ -188,8 +188,8 @@
// check for highest power
if (isset($this->_exponent[$p])) {
- // send substr from $curp to $p
- $snum = substr($num, $maxp - $curp, $curp - $p + 1);
+ // send mb_substr from $curp to $p
+ $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1);
$snum = preg_replace('/^0+/','',$snum);
if ($snum !== '') {
$cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1];
@@ -201,7 +201,7 @@
continue;
}
}
- $num = substr($num, $maxp - $curp, $curp - $p + 1);
+ $num = mb_substr($num, $maxp - $curp, $curp - $p + 1);
if ($num == 0) {
return $ret;
}
@@ -213,13 +213,13 @@
switch(mb_strlen($num)) {
case 3:
- $h = (int)substr($num,-3,1);
+ $h = (int)mb_substr($num,-3,1);
case 2:
- $t = (int)substr($num,-2,1);
+ $t = (int)mb_substr($num,-2,1);
case 1:
- $d = (int)substr($num,-1,1);
+ $d = (int)mb_substr($num,-1,1);
break;
case 0:
Modified: trunk/Numbers/Words/lang.en_100.php
===================================================================
--- trunk/Numbers/Words/lang.en_100.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.en_100.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -146,9 +146,9 @@
$ret = '';
// add a minus sign
- if (substr($num, 0, 1) == '-') {
+ if (mb_substr($num, 0, 1) == '-') {
$ret = $this->_sep . $this->_minus;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
// strip excessive zero signs and spaces
@@ -162,8 +162,8 @@
// check for highest power
if (isset($this->_exponent[$p])) {
- // send substr from $curp to $p
- $snum = substr($num, $maxp - $curp, $curp - $p + 1);
+ // send mb_substr from $curp to $p
+ $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1);
$snum = preg_replace('/^0+/','',$snum);
if ($snum !== '') {
$cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1];
@@ -176,7 +176,7 @@
continue;
}
}
- $num = substr($num, $maxp - $curp, $curp - $p + 1);
+ $num = mb_substr($num, $maxp - $curp, $curp - $p + 1);
if ($num == 0) {
return $ret;
}
@@ -188,13 +188,13 @@
switch(mb_strlen($num)) {
case 3:
- $h = (int)substr($num,-3,1);
+ $h = (int)mb_substr($num,-3,1);
case 2:
- $t = (int)substr($num,-2,1);
+ $t = (int)mb_substr($num,-2,1);
case 1:
- $d = (int)substr($num,-1,1);
+ $d = (int)mb_substr($num,-1,1);
break;
case 0:
Modified: trunk/Numbers/Words/lang.en_GB.php
===================================================================
--- trunk/Numbers/Words/lang.en_GB.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.en_GB.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -204,9 +204,9 @@
$ret = '';
// add a minus sign
- if (substr($num, 0, 1) == '-') {
+ if (mb_substr($num, 0, 1) == '-') {
$ret = $this->_sep . $this->_minus;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
// strip excessive zero signs and spaces
@@ -220,8 +220,8 @@
// check for highest power
if (isset($this->_exponent[$p])) {
- // send substr from $curp to $p
- $snum = substr($num, $maxp - $curp, $curp - $p + 1);
+ // send mb_substr from $curp to $p
+ $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1);
$snum = preg_replace('/^0+/','',$snum);
if ($snum !== '') {
$cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1];
@@ -233,7 +233,7 @@
continue;
}
}
- $num = substr($num, $maxp - $curp, $curp - $p + 1);
+ $num = mb_substr($num, $maxp - $curp, $curp - $p + 1);
if ($num == 0) {
return $ret;
}
@@ -245,13 +245,13 @@
switch(mb_strlen($num)) {
case 3:
- $h = (int)substr($num,-3,1);
+ $h = (int)mb_substr($num,-3,1);
case 2:
- $t = (int)substr($num,-2,1);
+ $t = (int)mb_substr($num,-2,1);
case 1:
- $d = (int)substr($num,-1,1);
+ $d = (int)mb_substr($num,-1,1);
break;
case 0:
Modified: trunk/Numbers/Words/lang.en_US.php
===================================================================
--- trunk/Numbers/Words/lang.en_US.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.en_US.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -296,9 +296,9 @@
$ret = '';
// add a minus sign
- if (substr($num, 0, 1) == '-') {
+ if (mb_substr($num, 0, 1) == '-') {
$ret = $this->_sep . $this->_minus;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
// strip excessive zero signs and spaces
@@ -312,8 +312,8 @@
// check for highest power
if (isset($this->_exponent[$p])) {
- // send substr from $curp to $p
- $snum = substr($num, $maxp - $curp, $curp - $p + 1);
+ // send mb_substr from $curp to $p
+ $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1);
$snum = preg_replace('/^0+/','',$snum);
if ($snum !== '') {
$cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1];
@@ -325,7 +325,7 @@
continue;
}
}
- $num = substr($num, $maxp - $curp, $curp - $p + 1);
+ $num = mb_substr($num, $maxp - $curp, $curp - $p + 1);
if ($num == 0) {
return $ret;
}
@@ -337,13 +337,13 @@
switch(mb_strlen($num)) {
case 3:
- $h = (int)substr($num,-3,1);
+ $h = (int)mb_substr($num,-3,1);
case 2:
- $t = (int)substr($num,-2,1);
+ $t = (int)mb_substr($num,-2,1);
case 1:
- $d = (int)substr($num,-1,1);
+ $d = (int)mb_substr($num,-1,1);
break;
case 0:
Modified: trunk/Numbers/Words/lang.es.php
===================================================================
--- trunk/Numbers/Words/lang.es.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.es.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -129,10 +129,10 @@
$ret = '';
// add a the word for the minus sign if necessary
- if (substr($num, 0, 1) == '-')
+ if (mb_substr($num, 0, 1) == '-')
{
$ret = $this->_sep . $this->_minus;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
@@ -147,13 +147,13 @@
{
// convert the number above the first 6 digits
// with it's corresponding $power.
- $snum = substr($num, 0, -6);
+ $snum = mb_substr($num, 0, -6);
$snum = preg_replace('/^0+/','',$snum);
if ($snum !== '') {
$ret .= $this->toWords($snum, $power + 6);
}
}
- $num = substr($num, -6);
+ $num = mb_substr($num, -6);
if ($num == 0) {
return $ret;
}
Modified: trunk/Numbers/Words/lang.es_AR.php
===================================================================
--- trunk/Numbers/Words/lang.es_AR.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.es_AR.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -189,10 +189,10 @@
$ret = '';
// add a the word for the minus sign if necessary
- if (substr($num, 0, 1) == '-')
+ if (mb_substr($num, 0, 1) == '-')
{
$ret = $this->_sep . $this->_minus;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
@@ -212,13 +212,13 @@
{
// convert the number above the first 6 digits
// with it's corresponding $power.
- $snum = substr($num, 0, -6);
+ $snum = mb_substr($num, 0, -6);
$snum = preg_replace('/^0+/','',$snum);
if ($snum !== '') {
$ret .= $this->toWords($snum, $power + 6);
}
}
- $num = substr($num, -6);
+ $num = mb_substr($num, -6);
if ($num == 0) {
return $ret;
}
Modified: trunk/Numbers/Words/lang.et.php
===================================================================
--- trunk/Numbers/Words/lang.et.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.et.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -235,9 +235,9 @@
function toWords($num, $power = 0, $powsuffix = '') {
$ret = '';
- if (substr($num, 0, 1) == '-') {
+ if (mb_substr($num, 0, 1) == '-') {
$ret = $this->_sep . $this->_minus;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
$num = trim($num);
@@ -248,7 +248,7 @@
$curp = $maxp;
for ($p = $maxp; $p > 0; --$p) { // power
if (isset($this->_exponent[$p])) {
- $snum = substr($num, $maxp - $curp, $curp - $p + 1);
+ $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1);
$snum = preg_replace('/^0+/','',$snum);
if ($snum !== '') {
$cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1];
@@ -260,7 +260,7 @@
continue;
}
}
- $num = substr($num, $maxp - $curp, $curp - $p + 1);
+ $num = mb_substr($num, $maxp - $curp, $curp - $p + 1);
if ($num == 0) {
return $ret;
}
@@ -272,13 +272,13 @@
switch(mb_strlen($num)) {
case 3:
- $h = (int)substr($num,-3,1);
+ $h = (int)mb_substr($num,-3,1);
case 2:
- $t = (int)substr($num,-2,1);
+ $t = (int)mb_substr($num,-2,1);
case 1:
- $d = (int)substr($num,-1,1);
+ $d = (int)mb_substr($num,-1,1);
break;
case 0:
Modified: trunk/Numbers/Words/lang.fr.php
===================================================================
--- trunk/Numbers/Words/lang.fr.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.fr.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -264,8 +264,8 @@
if (is_string($num)) {
$ret = array();
$mb_strlen = mb_strlen($num);
- $first = substr($num, 0, $mb_strlen%3);
- preg_match_all('/\d{3}/', substr($num, $mb_strlen%3, $mb_strlen), $m);
+ $first = mb_substr($num, 0, $mb_strlen%3);
+ preg_match_all('/\d{3}/', mb_substr($num, $mb_strlen%3, $mb_strlen), $m);
$ret =& $m[0];
if ($first) array_unshift($ret, $first);
return $ret;
@@ -397,9 +397,9 @@
if (!$num || preg_match('/^-?0+$/', $num) || !preg_match('/^-?\d+$/', $num)) return $this->_zero;
// add a minus sign
- if (substr($num, 0, 1) == '-') {
+ if (mb_substr($num, 0, 1) == '-') {
$ret = $this->_minus . $this->_sep;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
// if the absolute value is greater than 9.99*10^302, return infinity
Modified: trunk/Numbers/Words/lang.fr_BE.php
===================================================================
--- trunk/Numbers/Words/lang.fr_BE.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.fr_BE.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -268,8 +268,8 @@
if (is_string($num)) {
$ret = array();
$mb_strlen = mb_strlen($num);
- $first = substr($num, 0, $mb_strlen%3);
- preg_match_all('/\d{3}/', substr($num, $mb_strlen%3, $mb_strlen), $m);
+ $first = mb_substr($num, 0, $mb_strlen%3);
+ preg_match_all('/\d{3}/', mb_substr($num, $mb_strlen%3, $mb_strlen), $m);
$ret =& $m[0];
if ($first) array_unshift($ret, $first);
return $ret;
@@ -375,9 +375,9 @@
if (!$num || preg_match('/^-?0+$/', $num) || !preg_match('/^-?\d+$/', $num)) return $this->_zero;
// add a minus sign
- if (substr($num, 0, 1) == '-') {
+ if (mb_substr($num, 0, 1) == '-') {
$ret = $this->_minus . $this->_sep;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
// if the absolute value is greater than 9.99*10^302, return infinity
Modified: trunk/Numbers/Words/lang.he.php
===================================================================
--- trunk/Numbers/Words/lang.he.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.he.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -313,9 +313,9 @@
$ret = '';
// add a minus sign
- if (substr($num, 0, 1) == '-') {
+ if (mb_substr($num, 0, 1) == '-') {
$ret = $this->_sep . $this->_minus;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
// strip excessive zero signs and spaces
@@ -329,8 +329,8 @@
// check for highest power
if (isset($this->_exponent[$p])) {
- // send substr from $curp to $p
- $snum = substr($num, $maxp - $curp, $curp - $p + 1);
+ // send mb_substr from $curp to $p
+ $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1);
$snum = preg_replace('/^0+/','',$snum);
if ($snum !== '') {
$cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1];
@@ -342,7 +342,7 @@
continue;
}
}
- $num = substr($num, $maxp - $curp, $curp - $p + 1);
+ $num = mb_substr($num, $maxp - $curp, $curp - $p + 1);
if ($num == 0) {
return $ret;
}
@@ -354,13 +354,13 @@
switch(mb_strlen($num)) {
case 3:
- $h = (int)substr($num,-3,1);
+ $h = (int)mb_substr($num,-3,1);
case 2:
- $t = (int)substr($num,-2,1);
+ $t = (int)mb_substr($num,-2,1);
case 1:
- $d = (int)substr($num,-1,1);
+ $d = (int)mb_substr($num,-1,1);
break;
case 0:
Modified: trunk/Numbers/Words/lang.hu_HU.php
===================================================================
--- trunk/Numbers/Words/lang.hu_HU.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.hu_HU.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -204,9 +204,9 @@
$ret = '';
// add a minus sign
- if (substr($num, 0, 1) == '-') {
+ if (mb_substr($num, 0, 1) == '-') {
$ret = $this->_sep . $this->_minus;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
// strip excessive zero signs and spaces
@@ -220,8 +220,8 @@
// check for highest power
if (isset($this->_exponent[$p])) {
- // send substr from $curp to $p
- $snum = substr($num, $maxp - $curp, $curp - $p + 1);
+ // send mb_substr from $curp to $p
+ $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1);
$snum = preg_replace('/^0+/','',$snum);
if ($snum !== '') {
$cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1];
@@ -233,7 +233,7 @@
continue;
}
}
- $num = substr($num, $maxp - $curp, $curp - $p + 1);
+ $num = mb_substr($num, $maxp - $curp, $curp - $p + 1);
if ($num == 0) {
return $ret;
}
@@ -245,13 +245,13 @@
switch(mb_strlen($num)) {
case 3:
- $h = (int)substr($num,-3,1);
+ $h = (int)mb_substr($num,-3,1);
case 2:
- $t = (int)substr($num,-2,1);
+ $t = (int)mb_substr($num,-2,1);
case 1:
- $d = (int)substr($num,-1,1);
+ $d = (int)mb_substr($num,-1,1);
break;
case 0:
Modified: trunk/Numbers/Words/lang.id.php
===================================================================
--- trunk/Numbers/Words/lang.id.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.id.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -131,9 +131,9 @@
$ret = '';
// add a minus sign
- if (substr($num, 0, 1) == '-') {
+ if (mb_substr($num, 0, 1) == '-') {
$ret = $this->_sep . $this->_minus;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
// strip excessive zero signs and spaces
@@ -147,8 +147,8 @@
// check for highest power
if (isset($this->_exponent[$p])) {
- // send substr from $curp to $p
- $snum = substr($num, $maxp - $curp, $curp - $p + 1);
+ // send mb_substr from $curp to $p
+ $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1);
$snum = preg_replace('/^0+/','',$snum);
if ($snum !== '') {
$cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1];
@@ -160,7 +160,7 @@
continue;
}
}
- $num = substr($num, $maxp - $curp, $curp - $p + 1);
+ $num = mb_substr($num, $maxp - $curp, $curp - $p + 1);
if ($num == 0) {
return $ret;
}
@@ -172,16 +172,16 @@
switch(mb_strlen($num)) {
case 4:
- $th = (int)substr($num,-4,1);
+ $th = (int)mb_substr($num,-4,1);
case 3:
- $h = (int)substr($num,-3,1);
+ $h = (int)mb_substr($num,-3,1);
case 2:
- $t = (int)substr($num,-2,1);
+ $t = (int)mb_substr($num,-2,1);
case 1:
- $d = (int)substr($num,-1,1);
+ $d = (int)mb_substr($num,-1,1);
break;
case 0:
Modified: trunk/Numbers/Words/lang.it_IT.php
===================================================================
--- trunk/Numbers/Words/lang.it_IT.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.it_IT.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -125,10 +125,10 @@
$ret = '';
// add a the word for the minus sign if necessary
- if (substr($num, 0, 1) == '-')
+ if (mb_substr($num, 0, 1) == '-')
{
$ret = $this->_sep . $this->_minus;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
@@ -143,13 +143,13 @@
{
// convert the number above the first 6 digits
// with it's corresponding $power.
- $snum = substr($num, 0, -6);
+ $snum = mb_substr($num, 0, -6);
$snum = preg_replace('/^0+/','',$snum);
if ($snum !== '') {
$ret .= $this->toWords($snum, $power + 6);
}
}
- $num = substr($num, -6);
+ $num = mb_substr($num, -6);
if ($num == 0) {
return $ret;
}
Modified: trunk/Numbers/Words/lang.lt.php
===================================================================
--- trunk/Numbers/Words/lang.lt.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.lt.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -136,9 +136,9 @@
$ret = '';
// add a minus sign
- if (substr($num, 0, 1) == '-') {
+ if (mb_substr($num, 0, 1) == '-') {
$ret = $this->_sep . $this->_minus;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
// strip excessive zero signs and spaces
@@ -152,8 +152,8 @@
// check for highest power
if (isset($this->_exponent[$p])) {
- // send substr from $curp to $p
- $snum = substr($num, $maxp - $curp, $curp - $p + 1);
+ // send mb_substr from $curp to $p
+ $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1);
$snum = preg_replace('/^0+/','',$snum);
if ($snum !== '') {
$cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1];
@@ -165,7 +165,7 @@
continue;
}
}
- $num = substr($num, $maxp - $curp, $curp - $p + 1);
+ $num = mb_substr($num, $maxp - $curp, $curp - $p + 1);
if ($num == 0) {
return $ret;
}
@@ -177,13 +177,13 @@
switch(mb_strlen($num)) {
case 3:
- $h = (int)substr($num,-3,1);
+ $h = (int)mb_substr($num,-3,1);
case 2:
- $t = (int)substr($num,-2,1);
+ $t = (int)mb_substr($num,-2,1);
case 1:
- $d = (int)substr($num,-1,1);
+ $d = (int)mb_substr($num,-1,1);
break;
case 0:
Modified: trunk/Numbers/Words/lang.nl.php
===================================================================
--- trunk/Numbers/Words/lang.nl.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.nl.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -166,9 +166,9 @@
$ret = '';
// add a minus sign
- if (substr($num, 0, 1) == '-') {
+ if (mb_substr($num, 0, 1) == '-') {
$ret = $this->_sep . $this->_minus;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
// strip excessive zero signs and spaces
@@ -182,8 +182,8 @@
// check for highest power
if (isset($this->_exponent[$p])) {
- // send substr from $curp to $p
- $snum = substr($num, $maxp - $curp, $curp - $p + 1);
+ // send mb_substr from $curp to $p
+ $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1);
$snum = preg_replace('/^0+/','',$snum);
if ($snum !== '') {
$cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1];
@@ -195,7 +195,7 @@
continue;
}
}
- $num = substr($num, $maxp - $curp, $curp - $p + 1);
+ $num = mb_substr($num, $maxp - $curp, $curp - $p + 1);
if ($num == 0) {
return $ret;
}
@@ -207,13 +207,13 @@
switch(mb_strlen($num)) {
case 3:
- $h = (int)substr($num,-3,1);
+ $h = (int)mb_substr($num,-3,1);
case 2:
- $t = (int)substr($num,-2,1);
+ $t = (int)mb_substr($num,-2,1);
case 1:
- $d = (int)substr($num,-1,1);
+ $d = (int)mb_substr($num,-1,1);
break;
case 0:
Modified: trunk/Numbers/Words/lang.pl.php
===================================================================
--- trunk/Numbers/Words/lang.pl.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.pl.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -225,9 +225,9 @@
$ret = '';
// add a minus sign
- if (substr($num, 0, 1) == '-') {
+ if (mb_substr($num, 0, 1) == '-') {
$ret = $this->_sep . $this->_minus;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
// strip excessive zero signs and spaces
@@ -241,8 +241,8 @@
// check for highest power
if (isset($this->_exponent[$p])) {
- // send substr from $curp to $p
- $snum = substr($num, $maxp - $curp, $curp - $p + 1);
+ // send mb_substr from $curp to $p
+ $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1);
$snum = preg_replace('/^0+/','',$snum);
if ($snum !== '') {
$cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1];
@@ -254,7 +254,7 @@
continue;
}
}
- $num = substr($num, $maxp - $curp, $curp - $p + 1);
+ $num = mb_substr($num, $maxp - $curp, $curp - $p + 1);
if ($num == 0) {
return $ret;
}
@@ -266,13 +266,13 @@
switch(mb_strlen($num)) {
case 3:
- $h = (int)substr($num,-3,1);
+ $h = (int)mb_substr($num,-3,1);
case 2:
- $t = (int)substr($num,-2,1);
+ $t = (int)mb_substr($num,-2,1);
case 1:
- $d = (int)substr($num,-1,1);
+ $d = (int)mb_substr($num,-1,1);
break;
case 0:
@@ -476,18 +476,18 @@
* @since Numbers_Words 0.4
*/
function _get_numlevel($num) {
- $num = (int)substr($num,-3);
+ $num = (int)mb_substr($num,-3);
$h = $t = $d = $lev = 0;
switch(mb_strlen($num)) {
case 3:
- $h = (int)substr($num,-3,1);
+ $h = (int)mb_substr($num,-3,1);
case 2:
- $t = (int)substr($num,-2,1);
+ $t = (int)mb_substr($num,-2,1);
case 1:
- $d = (int)substr($num,-1,1);
+ $d = (int)mb_substr($num,-1,1);
break;
case 0:
Modified: trunk/Numbers/Words/lang.pt_BR.php
===================================================================
--- trunk/Numbers/Words/lang.pt_BR.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.pt_BR.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -219,9 +219,9 @@
$num = trim($num);
- if (substr($num, 0, 1) == '-') {
+ if (mb_substr($num, 0, 1) == '-') {
$ret = $this->_sep . $this->_minus;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
// strip excessive zero signs and spaces
Modified: trunk/Numbers/Words/lang.ru.php
===================================================================
--- trunk/Numbers/Words/lang.ru.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.ru.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -463,9 +463,9 @@
$num = trim($num);
$sign = "";
- if (substr($num, 0, 1) == '-') {
+ if (mb_substr($num, 0, 1) == '-') {
$sign = $this->_minus . $this->_sep;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
while (mb_strlen($num) % 3) $num = '0' . $num;
@@ -483,7 +483,7 @@
} else {
$groupgender = 1;
}
- $group = $this->_groupToWords(substr($num,-$power-3,3),$groupgender,$_case);
+ $group = $this->_groupToWords(mb_substr($num,-$power-3,3),$groupgender,$_case);
if (!$power) {
$case = $_case;
}
@@ -547,7 +547,7 @@
$hundreds = (int)$num{0};
if ($hundreds) {
$ret = $this->_hundreds[$hundreds];
- if (substr($num,1) != '00') {
+ if (mb_substr($num,1) != '00') {
$ret .= $this->_sep;
}
$case = 3;
Modified: trunk/Numbers/Words/lang.sv.php
===================================================================
--- trunk/Numbers/Words/lang.sv.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words/lang.sv.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -157,9 +157,9 @@
$ret = '';
// add a minus sign
- if (substr($num, 0, 1) == '-') {
+ if (mb_substr($num, 0, 1) == '-') {
$ret = $this->_sep . $this->_minus;
- $num = substr($num, 1);
+ $num = mb_substr($num, 1);
}
// strip excessive zero signs and spaces
@@ -173,8 +173,8 @@
// check for highest power
if (isset($this->_exponent[$p])) {
- // send substr from $curp to $p
- $snum = substr($num, $maxp - $curp, $curp - $p + 1);
+ // send mb_substr from $curp to $p
+ $snum = mb_substr($num, $maxp - $curp, $curp - $p + 1);
$snum = preg_replace('/^0+/','',$snum);
if ($snum !== '') {
$cursuffix = $this->_exponent[$power][count($this->_exponent[$power])-1];
@@ -186,7 +186,7 @@
continue;
}
}
- $num = substr($num, $maxp - $curp, $curp - $p + 1);
+ $num = mb_substr($num, $maxp - $curp, $curp - $p + 1);
if ($num == 0) {
return $ret;
}
@@ -198,13 +198,13 @@
switch(mb_strlen($num)) {
case 3:
- $h = (int)substr($num,-3,1);
+ $h = (int)mb_substr($num,-3,1);
case 2:
- $t = (int)substr($num,-2,1);
+ $t = (int)mb_substr($num,-2,1);
case 1:
- $d = (int)substr($num,-1,1);
+ $d = (int)mb_substr($num,-1,1);
break;
case 0:
Modified: trunk/Numbers/Words.php
===================================================================
--- trunk/Numbers/Words.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Numbers/Words.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -65,10 +65,10 @@
if (!file_exists('Numbers/Words/lang.' . $locale . '.php')){
//try to drop off the .utf8 suffix then recheck
if (mb_strpos($locale,'.utf8')){
- $locale = substr($locale, 0,mb_strpos($locale,'.utf8'));
+ $locale = mb_substr($locale, 0,mb_strpos($locale,'.utf8'));
}
if (!file_exists('Numbers/Words/lang.' . $locale . '.php')){
- $locale = substr($locale,0,2);
+ $locale = mb_substr($locale,0,2);
}
if (!file_exists('Numbers/Words/lang.' . $locale . '.php')){
$locale = 'en_US';
Modified: trunk/OffersReceived.php
===================================================================
--- trunk/OffersReceived.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/OffersReceived.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -134,8 +134,8 @@
$rejects=array();
$defers=array();
foreach ($_POST as $key => $value) {
- if(substr($key,0,6)=='action') {
- $OfferID=substr($key,6);
+ if(mb_substr($key,0,6)=='action') {
+ $OfferID=mb_substr($key,6);
switch ($value) {
case 1:
$accepts[]=$OfferID;
Modified: trunk/PO_AuthoriseMyOrders.php
===================================================================
--- trunk/PO_AuthoriseMyOrders.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/PO_AuthoriseMyOrders.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -17,8 +17,8 @@
if (isset($_POST['UpdateAll'])) {
foreach ($_POST as $key => $value) {
- if (substr($key,0,6)=='status') {
- $OrderNo=substr($key,6);
+ if (mb_substr($key,0,6)=='status') {
+ $OrderNo=mb_substr($key,6);
$Status=$_POST['status'.$OrderNo];
$Comment=date($_SESSION['DefaultDateFormat']).' - '._('Authorised by').' '.'<a href="mailto:' . $EmailRow['email'].'">'.$_SESSION['UserID'].'</a>
<br />' . $_POST['comment'];
Modified: trunk/PO_Items.php
===================================================================
--- trunk/PO_Items.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/PO_Items.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -504,9 +504,9 @@
foreach ($_POST as $FormVariableName => $Quantity) {
- if (substr($FormVariableName, 0, 6)=='NewQty') { //if the form variable represents a Qty to add to the order
+ if (mb_substr($FormVariableName, 0, 6)=='NewQty') { //if the form variable represents a Qty to add to the order
- $ItemCode = substr($FormVariableName, 6, mb_strlen($FormVariableName)-6);
+ $ItemCode = mb_substr($FormVariableName, 6, mb_strlen($FormVariableName)-6);
$AlreadyOnThisOrder = 0;
if ($_SESSION['PO_AllowSameItemMultipleTimes'] ==false){
Modified: trunk/PageSecurity.php
===================================================================
--- trunk/PageSecurity.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/PageSecurity.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -13,7 +13,7 @@
if (isset($_POST['Update'])) {
foreach ($_POST as $ScriptName => $PageSecurityValue) {
if ($ScriptName!='Update' and $ScriptName!='FormID') {
- $ScriptName = substr($ScriptName, 0, mb_strlen($ScriptName)-4).'.php';
+ $ScriptName = mb_substr($ScriptName, 0, mb_strlen($ScriptName)-4).'.php';
$sql="UPDATE scripts SET pagesecurity='".$PageSecurityValue."' WHERE script='".$ScriptName."'";
$UpdateResult=DB_query($sql, $db,_('Could not update the page security value for the script because'));
}
Modified: trunk/SalesCategories.php
===================================================================
--- trunk/SalesCategories.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/SalesCategories.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -39,7 +39,7 @@
$FileName = $_SESSION['part_pics_dir'] . '/cat_' . $SelectedCategory . '.jpg';
//But check for the worst
- if (strtoupper(substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){
+ if (strtoupper(mb_substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){
prnMsg(_('Only jpg files are supported - a file extension of .jpg is expected'),'warn');
$UploadTheFile ='No';
} elseif ( $_FILES['ItemPicture']['size'] > ($_SESSION['MaxImageSize']*1024)) { //File Size Check
Modified: trunk/SelectCreditItems.php
===================================================================
--- trunk/SelectCreditItems.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/SelectCreditItems.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -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'],mb_strpos($_POST['Select'],' - ')+3);
- $_POST['Select'] = substr($_POST['Select'],0,mb_strpos($_POST['Select'],' - '));
+ $_SESSION['CreditItems']->Branch = mb_substr($_POST['Select'],mb_strpos($_POST['Select'],' - ')+3);
+ $_POST['Select'] = mb_substr($_POST['Select'],0,mb_strpos($_POST['Select'],' - '));
/*Now retrieve customer information - name, salestype, currency, terms etc */
Modified: trunk/SelectOrderItems.php
===================================================================
--- trunk/SelectOrderItems.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/SelectOrderItems.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -25,7 +25,7 @@
if (isset($_POST['order_items'])){
foreach ($_POST as $key => $value) {
if (strstr($key,'itm')) {
- $NewItem_array[substr($key,3)] = trim($value);
+ $NewItem_array[mb_substr($key,3)] = trim($value);
}
}
}
Modified: trunk/SpecialOrder.php
===================================================================
--- trunk/SpecialOrder.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/SpecialOrder.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -332,7 +332,7 @@
if ($PartCount[0]!=0){
$PartAlreadyExists =True;
if (mb_strlen($PartCode)==20){
- $PartCode = "*" . strtoupper(substr($_SESSION['SPL']->PurchOrderNo,0,13)) . "_" . $SPLLine->LineNo;
+ $PartCode = "*" . strtoupper(mb_substr($_SESSION['SPL']->PurchOrderNo,0,13)) . "_" . $SPLLine->LineNo;
}
$PartCode = $PartCode . $Counter;
$Counter++;
Modified: trunk/Stocks.php
===================================================================
--- trunk/Stocks.php 2011-07-03 03:27:48 UTC (rev 4620)
+++ trunk/Stocks.php 2011-07-03 03:35:49 UTC (rev 4621)
@@ -43,7 +43,7 @@
$filename = $_SESSION['part_pics_dir'] . '/' . $StockID . '.jpg';
//But check for the worst
- if (strtoupper(substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){
+ if (strtoupper(mb_substr(trim($_FILES['ItemPicture']['name']),mb_strlen($_FILES['ItemPicture']['name'])-3))!='JPG'){
prnMsg(_('Only jpg files are supported - a file extension of .jpg is expected'),'warn');
$UploadTheFile ='No';
} elseif ( $_FILES['ItemPicture']['size'] > ($_SE...
[truncated message content] |