ref: refs/heads/SuSE-Linux-10_3-Branch
commit 6f18482beb24d68662ca8f7f227bfae6bc27fb5c
Author: Michael Andres
Date: Sat Oct 31 12:00:20 2009 +0100
Fixed password handling in URLs (bnc #347273, bnc #551646)
---
zypp/repo/RepoVariables.cc | 23 ++++++++---------------
1 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/zypp/repo/RepoVariables.cc b/zypp/repo/RepoVariables.cc
index 8bf617f..41c5d04 100644
--- a/zypp/repo/RepoVariables.cc
+++ b/zypp/repo/RepoVariables.cc
@@ -21,7 +21,7 @@ namespace zypp
{
namespace repo
{
-
+
RepoVariablesStringReplacer::RepoVariablesStringReplacer()
{}
@@ -31,19 +31,19 @@ RepoVariablesStringReplacer::~RepoVariablesStringReplacer()
std::string RepoVariablesStringReplacer::operator()( const std::string &value ) const
{
string newvalue(value);
-
+
// $arch
newvalue = str::gsub( newvalue,
"$arch",
ZConfig::instance().systemArchitecture().asString() );
// $basearch
-
+
Arch::CompatSet cset( Arch::compatSet( ZConfig::instance().systemArchitecture() ) );
Arch::CompatSet::const_iterator it = cset.end();
--it;
// now at noarch
--it;
-
+
Arch basearch = *it;
if ( basearch == Arch_noarch )
{
@@ -67,18 +67,11 @@ RepoVariablesUrlReplacer::~RepoVariablesUrlReplacer()
Url RepoVariablesUrlReplacer::operator()( const Url &value ) const
{
+ Url newurl( value );
RepoVariablesStringReplacer replacer;
- string transformed = replacer(value.asString());
- Url newurl;
- try {
- newurl = Url(transformed);
- }
- catch ( const Exception &e )
- {
- ZYPP_CAUGHT(e);
- // just return what we got
- return value;
- }
+ newurl.setPathData(replacer(value.getPathData()));
+ newurl.setQueryString(replacer(value.getQueryString()));
+
return newurl;
}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org