php-general Digest 11 Feb 2011 09:54:40 -0000 Issue 7176

Topics (messages 311241 through 311244):

Re: Turning off magic_quotes_gpc?
        311241 by: Bob McConnell
        311242 by: knl.bitflop.com

ob_flush, does it cause data to be sent over the wire immediately?
        311243 by: Tolas Anon

Bar Charts in PDFs
        311244 by: Tom Barrett

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
From: Michael Stroh

> I'm maintaining various php scripts on a server that was originally 
> configured to have magic_quotes_gpc turned on. The installed php
version 
> is 5.2.6. I've read that magic_quotes_gpc is deprecated in 5.3 and 
> continuing to use it is "highly discouraged." I've ran into a few
fields 
> that I believe this is causing issues with so I'm considering turning
it 
> off but am wondering what steps should I take to make sure that
nothing 
> breaks and what should I look out for? Also, is it still a good idea
to 
> turn off since this installation isn't yet at 5.3?

It's a good idea to turn it off as soon as possible. However, you need
to test your site to make sure it won't broke something first.

There is a way to undo the results of magic quotes. We have implemented
it on a number of sites so that we won't care when it gets turned off.
Early in the script we have the following code:

    // If magic quotes is on, we want to remove slashes
    if (get_magic_quotes_gpc()) {
      // Magic quotes is on
      $response = stripslashes($_GET[$key]);
    }

Bob McConnell

--- End Message ---
--- Begin Message ---
On Thu, 10 Feb 2011 14:52:26 -0500
"Bob McConnell" <r...@cbord.com> wrote:

> It's a good idea to turn it off as soon as possible. However, you need
> to test your site to make sure it won't broke something first.

You have to test not only your site, but also the data that possible
lies in the database, if any.

> There is a way to undo the results of magic quotes. We have
> implemented it on a number of sites so that we won't care when it
> gets turned off. Early in the script we have the following code:
> 
>     // If magic quotes is on, we want to remove slashes
>     if (get_magic_quotes_gpc()) {
>       // Magic quotes is on
>       $response = stripslashes($_GET[$key]);
>     }

Many people use this approach or something similar and when you use
that from the beginning of production, it's not a problem. 

If however you are going to turn Magic Quotes off while running a
production system where it was previously turned on, you might run into
problems. 

Don't trust this method blindly. You have to remember that stripslashes
will only remove a single slash. If, for some reason, data has been
pulled out, updated, and re-inserted it may contain several slashes
(because each time Magic Quotes will add a new slash).

If you are turning off Magic Quotes on a system that has been running
with Magic Quotes on, you have to inspect the data manually to be safe.

---
Kind regards

Kim N. Lesmer
Programmer/Unix systemadministrator

Web    : www.bitflop.com
E-mail : k...@bitflop.com

--- End Message ---
--- Begin Message ---
Hi..

For my curl_exec problem,
http://readlist.com/lists/lists.php.net/php-general/16/81195.html
http://curl.haxx.se/mail/lib-2011-02/0101.html

I need to know if this simple test will cause data to be sent every 25
seconds _over the wire_.

<?php
set_time_limit (0);
error_reporting (E_ALL);
for ($i=0; $i<((3600+1800)/25); $i++) {
        echo '.';
        ob_flush();
        sleep (25);
};
echo "wanted-data";
?>

reason; i just can't get my media import routines that only send
sporadic status messages to work for big video files.

--- End Message ---
--- Begin Message ---
Hi

I need to generate some PDF reports (1000s). Part of the report is a set of
bar charts (the results of a questionnaire). Each question has the same 5
answers (v.bad, bad, ok ,good, v.good) and the chart is the % distribution
of the answers.

My plan is to create a HTML version, using "some graph drawing"* (saving a
copy of the HTML to disk), creating a PDF version using html2pdf (saving a
copy to disk and emailing to the recipient).

I think html2pdf can handle this. But I have not had much success finding
something to draw my graphs. Any (free) simple libraries out there I could
be pointed towards?

Thanks!
Tom

--- End Message ---

Reply via email to