Jump to content

maxxd

Gurus
  • Posts

    1,659
  • Joined

  • Last visited

  • Days Won

    52

Posts posted by maxxd

  1. 's' is often used as the variable name for search terms. If the developer doesn't escape properly, and they used double quotes in their code, I think this particular bit would parse and stop script execution with the output that is the sha1 encrypted string of 'xyzt', which one would assume the sender knows. This would then mean that your search endpoint doesn't escape properly and is capable of evaluating php code, which means it could potentially output credentials, secrets, or simply damaging information. And yes, WordPress uses 's' as the search variable name by default - as do other CMS systems and frameworks, but as requinix pointed out WordPress has more than it's fair share of issues and potential vulnerabilities.

    • Great Answer 1
  2. What minifier are you using? As requinix pointed out, `.class1.class2` is very different from `.class1 .class2` and if your minifier is adding or removing spaces like that it's broken. I always had good luck with cssmin if you're using gulp - I assume it's usable via webpack.

  3. Check your cURL version across your environments. I had a similar issue once - Centos 6 uses an old version of cURL apparently, so everything I was doing locally and on the staging server worked perfectly but blew up completely on production until I manually updated the cURL version.

  4. Are you actually using a font named Bold? The rest of the CSS should be working, so make sure it's being included into the HTML - can the calling page actually find it? Add

    body{
    	background-color: red;
    }

    to your CSS sheet.

  5. Or you could be really tricky with it:

    <style>
    .circle-2-colors{
      height: 0;
      width: 0;
      border-top: 15px solid red;
      border-right: 15px solid red;
      border-bottom: 15px solid blue;
      border-left: 15px solid blue;
      border-radius: 50%;
      transform: rotate(45deg);
    }
    </style>

     

  6. Hi y'all.

    I just inherited a legacy system that is in mid-rebuild but needs to be tended until it can be completely phased out and have run into an issue I can't remember how to deal with. The file system is as such:

    DocumentRoot/
         m/
         js/
         css/

    In the 'm' directory I have many files that use require_once as so:

    require_once "m/another_file.php";

    The problem is that none of them have a $_SERVER['DOCUMENT_ROOT'] or even a __DIR__ to start the path, so I'm blowing up with errors. I know this code works as it's currently in production, but I can't remember for the life of me what php.ini or .htaccess setting needs to be set to make it viable. My coworker swears he didn't have to do any magic to make it work on his system. Anybody old enough to remember?

  7. foreach() the way you're using it is going to pass each individual value of the array into the function body, so you don't need to reference $contacts[$var]. I assume the first value in your $contacts array is '18733', right? But there's probably not an index of 18733 in the $contacts array. Try this:

    foreach($contacts as $var){
        echo $var.PHP_EOL;
    }

    You should see each value of your array on a separate line.

  8. Post getTableColumns() and getTableData().

    Looking at everything, it kinda looks like you're overthinking things - you want the column names as table headers and the data as the table data, right? That's not how your output is set up right now. It's going to loop through all the records in tableData and output the column names for every line of data. But you're not printing the data and it seems like there's no actual header row output. I recommend drawing out what you want to see on paper - map the source for every table cell, then write the code to make that output happen.

  9. If it's one or several predefined page(s), does the built-in password protection not work? It should limit access to either those users with a password or admin/editor permissions.

    If that doesn't do it, I think I used to use the 'init' hook to check if the user is logged in and any custom permissions associated with that login - it's run after 'set_current_user' so it should be good. Although, it may have been the 'wp_loaded' hook - sorry, it's been a bit.

  10. What exactly are you expecting and what exactly are you getting? You say you're trying to understand functions - groovy.

    Functions basically work like this: you pass some parameters to a function when you call it (sometimes), and at the same time (most of the time) you assign whatever that function does with those parameters and then returns to a "local" variable. I put "local" in quotes because functions, methods, classes, and objects all have different meanings and potentially different scopes - which is another thing you'll want to look into as you learn the way this all works.

  11. I think you mean "pretty URL" or sometimes "friendly URL".

    Yes, you can do that with your .htaccess file, but it'll probably take some php coding as well. If you look at open-source CMSes and frameworks you'll get the basic idea - WordPress, Laravel, and Codeigniter are all examples I've personally used. Check out the .htaccess and index.php files, and follow the trail from there. You can also just google it and come up with plenty of examples.

    • Thanks 1
  12. 3 hours ago, SaranacLake said:

    Maybe if you buy an Amazon or B&N book, but if I created my own EPUB or MOBI, I don't think it comes with any DRM but I could be wrong.

    Honestly, I don't know - as I said, I've never published my own eBook.

    3 hours ago, SaranacLake said:

    What about my questions/concerns about trying to read a tutorial with lots of photos/images/screenshots on a smartphone?

    I'm not sure how I could make that work?

    If you're going the straight HTML route that's where the picture element comes in - it's not just the same image resized, you can specify completely different images for each media query break and not have to worry about downloading the other(s) first. So you can crop a screen shot differently for smartphone display than for desktop or tablet, and the media queries would call in the correct one.

  13. 2 hours ago, SaranacLake said:

    I am pretty sure the media queries just determine which image gets displayed, but they don't have the ability to stop your web page from downloading a larger image, but maybe I'm wrong.

    I'm talking about media queries associated with the picture element, not CSS. There's more information here.

    2 hours ago, SaranacLake said:

    I also thought about offering eBooks, but I have the same fear of piracy as with PDFs.

    I've not created any eBooks myself, but doesn't it handle the DRM natively? I'm pretty sure if I buy a Barnes and Noble book on my nook I can't just transfer the file to my wife's computer and open it - I think I have to be in another nook app and logged in with the same credentials. Although I'm not actually sure I've tried that now that I type it out loud...

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.