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

      Full-Stack Techies vs Toptal: Which Is Better for React.js Outsourcing?

      July 3, 2025

      The AI productivity paradox in software engineering: Balancing efficiency and human skill retention

      July 2, 2025

      The impact of gray work on software development

      July 2, 2025

      CSS Intelligence: Speculating On The Future Of A Smarter Language

      July 2, 2025

      Your Roku has secret menus and screens – here’s how to unlock them

      July 3, 2025

      Add Paramount+, STARZ, and more to your Prime Video account for $0.99 a month – here’s how

      July 3, 2025

      My new favorite keychain accessory gives me 2TB of SSD storage instantly

      July 3, 2025

      HP’s latest OmniBook finally sold me on the 2-in-1 form factor (and it’s on sale)

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

      Simplifying Stream Handling with Laravel’s resource Method

      July 3, 2025
      Recent

      Simplifying Stream Handling with Laravel’s resource Method

      July 3, 2025

      Intelligent Parsing and Formatting of Names in PHP Applications

      July 3, 2025

      This Week in Laravel: Cursor Rules, Nightwatch Review, and Race Conditions

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

      Microsoft confirms Windows 11 KB5060829 issues, but you can safely ignore it

      July 3, 2025
      Recent

      Microsoft confirms Windows 11 KB5060829 issues, but you can safely ignore it

      July 3, 2025

      Hash Calculator – calculates around 50 cryptographic hashes of strings and files

      July 3, 2025

      Rilasciato Thunderbird 140 ESR: Un’attenzione alle esigenze aziendali

      July 3, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»CodeSOD: The Last Last Name

    CodeSOD: The Last Last Name

    July 3, 2025

    Sometimes, you see some code which is perfectly harmless, but illustrates an incredibly dangerous person behind them. The code isn’t good, but it isn’t bad in any meaningful way, but they were written by a cocaine addled pomeranian behind the controls of a bulldozer: it’s full of energy, doesn’t know exactly what’s going on, and at some point, it’s going to hit something important.

    Such is the code which Román sends us.

    public static function registerUser($name, $lastName, $username, ...) {
        // 100% unmodified first lines, some comments removed
        $tsCreation = new DateTime();
        $user = new User();
          
        $name = $name;
        $lastname = $lastName;
        $username = $username;
           
        $user->setUsername($username);
    	$user->setLastname($lastname);
    	$user->setName($name);
    	// And so on.
    }
    

    This creates a user object and populates its fields. It doesn’t use a meaningful constructor, which is its own problem, but that’s not why we’re here. We’re here because for some reason the developer behind this function assigns some of the parameters to themselves. Why? I don’t know, but it’s clearly the result of some underlying misunderstanding of how things work.

    But the real landmine is the $lastname variable- which is an entirely new variable which has slightly different capitalization from $lastName.

    And you’ve all heard this song many times, so sing along with the chorus: “this particular pattern shows up all through the codebase,” complete with inconsistent capitalization.

    [Advertisement]
    Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleFOSS Weekly #25.27: System Info, Retro Tools, Fedora 32-bit Update, Torvalds vs Bcachefs and More Linux Stuff
    Next Article AssetCool raises £10M Series A to scale robotic grid upgrade technology globally

    Related Posts

    News & Updates

    Your Roku has secret menus and screens – here’s how to unlock them

    July 3, 2025
    News & Updates

    Add Paramount+, STARZ, and more to your Prime Video account for $0.99 a month – here’s how

    July 3, 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-47299 – Apache HTTP Server Unvalidated User Input

    Common Vulnerabilities and Exposures (CVEs)

    Sam Altman says GPT-4 “kind of sucks” as OpenAI discontinues its model for the “magical” GPT-4o in ChatGPT

    News & Updates

    shadPS4 is a cross-platform PlayStation 4 emulator

    Linux

    Scalable Reinforcement Learning with Verifiable Rewards: Generative Reward Modeling for Unstructured, Multi-Domain Tasks

    Machine Learning

    Highlights

    CVE-2025-47931 – LibreNMS Stored Cross-Site Scripting (XSS) Vulnerability

    May 17, 2025

    CVE ID : CVE-2025-47931

    Published : May 17, 2025, 4:15 p.m. | 30 minutes ago

    Description : LibreNMS is PHP/MySQL/SNMP based network monitoring software. LibreNMS v25.4.0 and prior suffers from a Stored Cross-Site Scripting (XSS) Vulnerability in the `group name` parameter of the `http://localhost/poller/groups` form. This vulnerability allows attackers to inject malicious scripts into web pages viewed by other users. LibreNMS v25.5.0 contains a patch for the issue.

    Severity: 0.0 | NA

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

    TarotCaster is an AI-powered tarot reading program

    June 18, 2025

    CVE-2025-47684 – Smaily for WP CSRF Vulnerability

    May 7, 2025

    CVE-2025-43863 – vantage6 is an open source framework built to enab

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

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