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

      10 Top Node.js Development Companies for Enterprise-Scale Projects (2025-2026 Ranked & Reviewed)

      July 4, 2025

      12 Must-Know Cost Factors When Hiring Node.js Developers for Your Enterprise

      July 4, 2025

      Mirantis reveals Lens Prism, an AI copilot for operating Kubernetes clusters

      July 3, 2025

      Avoid these common platform engineering mistakes

      July 3, 2025

      “A fantastic device for creative users” — this $550 discount on ASUS’s 3K OLED creator laptop disappears before Prime Day

      July 5, 2025

      Distribution Release: Rhino Linux 2025.3

      July 5, 2025

      Just days after joining Game Pass, the Xbox PC edition of Call of Duty: WW2 is taken offline for “an issue”

      July 5, 2025

      Xbox layoffs and game cuts wreak havoc on talented developers and the company’s future portfolio — Weekend discussion 💬

      July 5, 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

      Flaget – new small 5kB CLI argument parser

      July 5, 2025
      Recent

      Flaget – new small 5kB CLI argument parser

      July 5, 2025

      The dog days of JavaScript summer

      July 4, 2025

      Databricks Lakebase – Database Branching in Action

      July 4, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Fixing ‘failed to synchronize all databases’ Pacman Error in Arch Linux

      July 6, 2025
      Recent

      Fixing ‘failed to synchronize all databases’ Pacman Error in Arch Linux

      July 6, 2025

      “A fantastic device for creative users” — this $550 discount on ASUS’s 3K OLED creator laptop disappears before Prime Day

      July 5, 2025

      Distribution Release: Rhino Linux 2025.3

      July 5, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»Representative Line: Get Explosive

    Representative Line: Get Explosive

    April 3, 2025

    Sean sends us a one-line function that is a delight, if by delight you mean “horror”. You’ll be shocked to know it’s PHP.

    function proget(){foreach($_GET as $k=>$v){if($k=="h"){$GLOBALS["h"]=1;}$p=explode(",",$k);}return($p);} //function to process GET headers
    

    Based on the comment, proget is a shorthand for process_get_parameters. Which is sort of what it does. Sort of.

    Let’s go through this. We iterate across our $_GET parameters using $k for the key, $v for the value, but we never reference the value so forget it exists. We’re iterating across every key. The first thing we check is if a key "h" exists. We don’t look at its value, we just check if it exists, and if it does, we set a global variable. And this, right here, is enough for this to be a WTF. The logic of “set a global variable based on the existence of a query parameter regardless of the value of the query parameter” is… a lot. But then, somehow, this actually gets more out there.

    We explode the key on commas (explode being PHP’s much cooler name for split), which implies… our keys may be lists of values? Which I feel like is an example of someone not understanding what a “key” is. But worse than that, we just do this for every key, and return the results of performing that operation on the last key. Which means that if this function is doing anything at all, it’s entirely dependent on the order of the keys. Which, PHP does order the keys by the order they’re added, which I take to mean that if the URL has query params like ?foo=1&h=0&a,b,c,d=wtf. Or, if we’re being picky about encoding, ?foo=1&h=0&a%2Cb%2Cc%2Cd=wtf. The only good news here is that PHP handles the encoding/decoding for you, so the explode will work as expected.

    This is the kind of bad code that leaves me with lots of questions, and I’m not sure I want any of the answers. How did this happen, and why are questions best left unanswered, because I think the answers might cause more harm.

    [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 ArticleFOSS Weekly #25.14: Fedora 42 COSMIC, OnePackage, AppImage Tools and More Linux Stuff
    Next Article Rilasciato Qt 6.9: il framework per interfacce grafiche si aggiorna con prestazioni potenziate e nuovo supporto emoji

    Related Posts

    News & Updates

    “A fantastic device for creative users” — this $550 discount on ASUS’s 3K OLED creator laptop disappears before Prime Day

    July 5, 2025
    News & Updates

    Distribution Release: Rhino Linux 2025.3

    July 5, 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

    CVE-2025-6547 – Apache PBKDF2 Signature Spoofing Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Best Buy is giving away $300 gift cards when you buy a Hisense TV – here’s how to qualify

    News & Updates

    CVE-2025-33074 – Microsoft Azure Functions Cryptographic Signature Verification Bypass

    Common Vulnerabilities and Exposures (CVEs)

    Amap – Gather Info in Easy Way

    Learning Resources

    Highlights

    CVE-2025-48136 – Estatik Mortgage Calculator PHP Remote File Inclusion Vulnerability

    May 16, 2025

    CVE ID : CVE-2025-48136

    Published : May 16, 2025, 4:15 p.m. | 47 minutes ago

    Description : Improper Control of Filename for Include/Require Statement in PHP Program (‘PHP Remote File Inclusion’) vulnerability in Estatik Mortgage Calculator Estatik allows PHP Local File Inclusion. This issue affects Mortgage Calculator Estatik: from n/a through 2.0.12.

    Severity: 7.5 | HIGH

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    CVE-2025-6888 – PHPGurukul Teachers Record Management System SQL Injection Vulnerability

    June 30, 2025

    CVE-2025-41427 – WRC-X3000GS, WRC-X3000GSA, and WRC-X3000GSN OS Command Injection Vulnerability in Connection Diagnostics Page

    June 24, 2025

    Researcher Says Patched Commvault Bug Still Exploitable

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

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