Al Pacino, 85, gets VERY cozy with another woman decades younger than him as legendary star films in Rome
CodeSOD: And Config
It's not unusual to store format templates in your application configuration files. I'd argue it's probably a good and wise thing to do. But Phillip inherited a C# application from a developer who "abandoned" it, and there were some choices in there.
<appSettings> <add key="xxxurl" value="[http://{1}:7777/pls/xxx/p_pristjek?i_type=MK3000{0}i_ean={3}{0}i_style=http://{2}/Content/{0}i_red=http://{2}/start.aspx/]http://{1}:7777/pls/xxx/p_pristjek?i_type=MK3000{0}i_ean={3}{0}i_style=http://{2}/Content/{0}i_red=http://{2}/start.aspx"/> </appSettings>Okay, I understand that this field contains URLs, but I don't understand much else about what's going on here. It's unreadable, but also, it has some URLs grouped inside of a [] pair, but others which aren't, and why oh why does the {0} sigil keep showing up so much?
Maybe it'll make more sense after we fill in the template?
var url = string.Format(xxxUrl, "&", xxxIp, srvUrl, productCode);Oh. It's an "&". Because we're constructing a URL query string, which also seems to contain URLs, which I suspect is going to have some escaping issues, but it's for a query string.
At first, I was wondering why they did this, but then I realized: they were avoiding escape characters. By making the ampersand a formatting parameter, they could avoid the need to write & everywhere. Which… I guess this is a solution?
Not a good solution, but… a solution.
I still don't know why the same URL is stored twice in the string, once surrounded by square brackets and once not, and I don't think I want to know. Only bad things can result from knowing that.
[Advertisement] Plan Your .NET 9 Migration with ConfidenceYour journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. Download Free Guide Now!
Amazon's latest Graviton 4 EC2 instances pack dual 300Gbps NICs
Amazon Web Services has cooked up a new Graviton 4-powered instance tuned for network-intensive applications like cloud firewalls and load balancers.…
We're TV property experts: Here's what's REALLY putting buyers off your home
Why Sydney Sweeney attended Jeff Bezos and Lauren Sanchez wedding despite 'not being friends with either of them'
Here comes the hot second wife! Pia Whitesell shows off her incredible figure in a tiny sheer outfit at desert rave with husband Patrick after Bezos-Sanchez wedding
Essex primary school upgraded to 'outstanding' after inspection
The must-have sleep essential every traveller needs - but hardly anyone has: 'Absolutely genius'
Victoria Beckham and Geri Halliwell will NOT be at Mel B's star-studded wedding
Russell Crowe explains the secret meaning behind the tie he wore at Wimbledon with fiancée Britney Theriot
First trailer for Matt Damon's $250million epic film The Odyssey leaks online
The Essex postcodes that scooped People's Postcode Lottery prizes in June - including one that won £10,000
Trans swimmer Lia Thomas' wins will be WIPED and runners-up moved to first place after Penn bowed to Trump crackdown
Shock loophole that means Bryan Kohberger could still face death penalty despite plea deal... and a sensational new Luigi Mangione link
Arista acquires VMware’s VeloCloud SD-WAN outfit from Broadcom
Broadcom has sold VeloCloud, the software-defined WAN business VMware acquired in 2017, to Arista.…