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

      Your smart home device just got a performance and security boost for free

      August 18, 2025

      Ultrahuman brings advanced cycle and ovulation tracking to its smart ring

      August 18, 2025

      DistroWatch Weekly, Issue 1135

      August 17, 2025

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

      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

    Your smart home device just got a performance and security boost for free

    August 18, 2025
    News & Updates

    Ultrahuman brings advanced cycle and ovulation tracking to its smart ring

    August 18, 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

    Ivanti Fixes RCE and Auth Bypass Vulnerabilities in Endpoint Manager Mobile

    Development

    Salesforce research lays the foundations for more reliable enterprise AI agents

    News & Updates

    The 75-inch Toshiba C350 is a great budget TV, and it just dropped below $500

    News & Updates

    Can I play Grounded 2 on Steam Deck, ROG Ally, and other handheld gaming PCs?

    News & Updates

    Highlights

    Marks & Spencer ransomware attack was good news for other retailers

    June 24, 2025

    When Marks & Spencer paused online orders after it was hit by ransomware, it was…

    CVE-2025-1993 – IBM App Connect Enterprise Certified Container Cryptographic Weakness

    May 9, 2025

    Microsoft & Aduna Team Up to Scale Intelligent Network APIs Globally via Azure

    June 18, 2025

    CVE-2025-0037 – AMD Versal Adaptive SoC PLM Firmware Memory Access Vulnerability

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

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