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

      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

      I brought Samsung’s rugged Galaxy tablet on a hiking trip, and it weathered everything

      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

      AI’s Hidden Thirst: The Water Behind Tech

      August 16, 2025
      Recent

      AI’s Hidden Thirst: The Water Behind Tech

      August 16, 2025

      Minesweeper game in 100 lines of pure JavaScript – easy tutorial

      August 16, 2025

      Maintaining Data Consistency with Laravel Database Transactions

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

      5 Best VPN for Lenovo Laptops to Enjoy the Web Safely

      August 16, 2025
      Recent

      5 Best VPN for Lenovo Laptops to Enjoy the Web Safely

      August 16, 2025

      3 Best Antivirus and Malware Protection Software

      August 16, 2025

      11 Best Antivirus Without Ads

      August 16, 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 it was 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

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

    August 17, 2025
    News & Updates

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

    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

    CodeSOD: Integral to a Database Read

    News & Updates

    Building a Multi-Step Form With Laravel, Livewire, and MongoDB

    Development

    How to Use MongoDB with Go

    Development

    CVE-2025-45237 – DBSyncer Unsecured Configuration File Access Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    News & Updates

    Forget Amazon — Best Buy’s early anti-Prime Day deals are live, with huge savings on some of our favorite tech

    July 1, 2025

    Best Buy’s 4th of July sale already has countless deep discounts on some of our…

    Securing Amazon Bedrock Agents: A guide to safeguarding against indirect prompt injections

    May 13, 2025

    CVE-2025-0856 – WordPress PGS Core Plugin Unauthenticated Remote Data Manipulation

    May 6, 2025

    LWiAI Podcast #214 – Gemini CLI, io drama, AlphaGenome

    July 4, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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