Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      The Psychology Of Color In UX Design And Digital Products

      August 15, 2025

      This week in AI dev tools: Claude Sonnet 4’s larger context window, ChatGPT updates, and more (August 15, 2025)

      August 15, 2025

      Sentry launches MCP monitoring tool

      August 14, 2025

      10 Benefits of Hiring a React.js Development Company (2025–2026 Edition)

      August 13, 2025

      DistroWatch Weekly, Issue 1135

      August 17, 2025

      14 secret phone codes that unlock hidden features on your Android and iPhone

      August 17, 2025

      Stop using AI for these 9 work tasks – here’s why

      August 17, 2025

      A smart sensor assessed my home’s risk of electrical fires, and I was impressed

      August 17, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Air Quality Prediction System using Python ML

      August 17, 2025
      Recent

      Air Quality Prediction System using Python ML

      August 17, 2025

      AI’s Hidden Thirst: The Water Behind Tech

      August 16, 2025

      Minesweeper game in 100 lines of pure JavaScript – easy tutorial

      August 16, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      DistroWatch Weekly, Issue 1135

      August 17, 2025
      Recent

      DistroWatch Weekly, Issue 1135

      August 17, 2025

      Ubuntu’s New “Dangerous” Daily Builds – What Are They?

      August 17, 2025

      gofmt – formats Go programs

      August 17, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»CodeSOD: And Config

    CodeSOD: And Config

    July 2, 2025

    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 &amp; 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 Confidence
    Your journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. Download Free Guide Now!

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticlePilz IndustrialPI 4 Alert: Critical Flaws (CVE-2025-41656 CVSS 10.0 RCE, CVE-2025-41648 Auth Bypass) Expose Industrial PCs
    Next Article CutePeaks – cross platform Sanger Trace file viewer

    Related Posts

    News & Updates

    DistroWatch Weekly, Issue 1135

    August 17, 2025
    News & Updates

    14 secret phone codes that unlock hidden features on your Android and iPhone

    August 17, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    Microsoft Copilot will soon help you prioritize emails in Outlook

    News & Updates

    This custom magnetic keyboard shows how “gaming” is becoming less of a category and more of a feature set

    News & Updates

    SonicWall NetExtender Trojan and ConnectWise Exploits Used in Remote Access Attacks

    Development

    CVE-2025-7754 – Code-projects Patient Record Management System SQL Injection Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    5 Best Free and Open Source Font Managers

    July 3, 2025

    Need an efficient way to manage your fonts? Step forward a dedicated font manager utility.…

    Microsoft is adding Clock to Windows 11 Calendar flyout after removing it in Windows 10

    April 15, 2025

    CVE-2025-46733 – OP-TEE Secure Storage API Panic Vulnerability

    July 4, 2025

    Assigning and completing issues with coding agent in GitHub Copilot

    June 6, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.