From 26b2fca8f504d12dcc160f347e4ecccc111e5614 Mon Sep 17 00:00:00 2001 From: "qiang.xue" Date: Wed, 16 Jun 2010 19:52:29 +0000 Subject: [PATCH] --- framework/cli/commands/WebAppCommand.php | 8 +++++++- framework/i18n/gettext/CGettextMoFile.php | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/framework/cli/commands/WebAppCommand.php b/framework/cli/commands/WebAppCommand.php index d4cce032e..742afdc3c 100644 --- a/framework/cli/commands/WebAppCommand.php +++ b/framework/cli/commands/WebAppCommand.php @@ -110,7 +110,13 @@ EOD; $segs2=explode(DIRECTORY_SEPARATOR,$path2); $n1=count($segs1); $n2=count($segs2); - + + for($i=0;$i<$n1 && $i<$n2;++$i) + { + if($segs1[$i]!==$segs2[$i]) + break; + } + if($i===0) return "'".$path1."'"; $up=''; diff --git a/framework/i18n/gettext/CGettextMoFile.php b/framework/i18n/gettext/CGettextMoFile.php index 32e3e538c..328581b80 100644 --- a/framework/i18n/gettext/CGettextMoFile.php +++ b/framework/i18n/gettext/CGettextMoFile.php @@ -74,7 +74,7 @@ class CGettextMoFile extends CGettextFile throw new CException(Yii::t('yii','Unable to lock file "{file}" for reading.', array('{file}'=>$file))); - $magic=current(unpack('c',$this->readByte($fr,4))); + $magic=current($array=unpack('c',$this->readByte($fr,4))); if($magic==-34) $this->useBigEndian=false; else if($magic==-107)