#php
13 November 2007
Total 41 pages. You are browsing page 1/41.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
--- Log opened Tue Nov 13 00:00:01 2007
--- Day changed Tue Nov 13 2007
00:00 <****> anyone here a self-proclaimed smarty expert? noone's answering in #smarty...
00:00 <****> I kept escaping magic quoted strings when I first started and got \' in my database
00:00 * AlReece45 calls for php-bot
00:01 <****> sketch|work, gtfo out my php channel we don't support that retarded crap.
00:01 <****> go ask #smarty until their lazy arses answer you
00:02 <****> Hmm.. is it best to do if (get_magic_quotes_gpc()) stripslashes() ?
00:02 <****> cythrawll: great attitude, thanks for your assistance.
00:02 <****> glad I can help :)
00:02 <****> Because if you stripslashes when magic quotes is off that could be bad
00:02 <****> yeah, you have to jump through retarded hoops unfortunately
00:02 <****> cyth, you doo need to chill out man
00:02 <****> lol, the docs do it the other way around :D
00:03 <****> Borbus: that's not safe in itself, use PHP_Compat
00:03 <****> nrvld, nah, it's cool
00:03 <****> if (!get_magic_quotes_gpc()) addslashes(); :D
00:03 <****> "Guideline #8) SQL Q's: #sql, #mysql or #postgresql. Apache Q's: #apache. Linux Q's: Either #yourdistro, #linuxhelp or #linpeople. HTML/CSS/JavaScript Q's: #web. Just because some other channel is 'dead' does NOT mean you can ask here."
00:03 <****> Borbus: a few ways around magic quotes: disable it in server config (if available), disable it with htaccess (if available), else, if (get_magic_quotes_gpc) customStripSlashesFromAllRequestData function (include cookies, post, get, etc)
00:03 <****> For preparing SQL statements?
00:03 <****> ideally disable it completely, if you must do it at runtime then use PHP_Compat
00:04 <****> What is PHP_Compat?
00:04 <****> also is get_magic_quotes settable via ini_set?
00:04 <****> cythrawll: no
00:04 <****> darn
00:04 <****> Borbus: http://pear.php.net/package/PHP_Compat
00:04 <****> too late at ini_set time
00:04 <****> well, .htaccess ftw then
00:04 <****> Oh.. I misread that.. thought it said Perl :P
00:05 <****> hello all
00:05 <****> How do you turn it off with .htaccess?
00:05 <****> php_flag magic_quotes_gpc off
00:05 <****>Name (wrong way) here? http://pastebin.ca/771380
00:05 <****> Ahh
00:05 <****> So if you do that in .htaccess then you shouldn't use stripslashes() at all?
00:06 <****> Borbus: yes
00:06 <****> But what about for general release?
00:06 <****> then you have to include the retarded hoops, yeah
00:06 <****> i have a very small scriptlet
00:07 <****> Borbus: bundle the PHP_Compat code if it fits your license, or recreate it
00:07 <****> that gets run in the main config file of all apps i develop. it does strip_slashes on the var
00:07 <****> So what was wrong with if (get_magic_quotes_gpc()) stripslashes(); again?
00:07 <****> Borbus: nothing, it's a great approach - just remember to handle arrays and all the different $_ var's
00:07 <****> what if you have subarrays in your gpc arrays?
00:07 <****> Borbus: php has implemented magic_quotes_gpc very inconsistently between versions, doing it yourself is very difficult...
00:08 <****> http://cvs.php.net/viewvc.cgi/pear/PHP_Compat/Compat/Environment/magic_quotes_gpc_off.php?revision=1.7&view=markup
00:08 <****> http://cvs.php.net/viewvc.cgi/pear/PHP_Compat/Compat/Environment/_magic_quotes_inputs.php?revision=1.3&view=markup
00:08 <****> Oh, I see
00:08 <****> Borbus: also, you need to do it recursively as well as applying stripslashes to the keys
00:09 <****> handy, that code, thanks
00:09 <****> AlReece45: doing it recursively is not a good idea unless you can reasonably enforce a recursion limit, php isn't great at recursion
00:11 <****> Magic quotes only applies to stuff from $_GET and $_POST though doesn't it?
00:11 <****> Oh, and COOKIE
00:11 <****> and $_COOKIE, and their $HTTP_ equivalents, and also $_SERVER and $_ENV in php4
00:12 <****> Omg.. I didn't know about runtime and sybase
00:12 <****> Is sybase off by default?
00:13 <****> arpad: that function basically does the same thing as recursion (which is what I meant)...
00:13 <****> Borbus: yes, it's quite uncommon, mostly used when the default db is mssql
00:14 <****> AlReece45: it does exactly the same thing, but it works interatively instead of recursively which performs much better in php
00:14 <****> um, iteratively
00:14 <****> duh, php4 is officially unsupported at the end of the year ?
00:15 <****> orogor: you think thousands of hosts will instantly switch over?
00:16 <****> the EOL announcement was a big kick in the arse but it's no panacea
00:17 <****> Is there a way to die/exit without decontructors being ran?
00:17 <****> i see there s a compatibility mode
00:17 <****> i just enabled it ... i can still view the source of my page
00:17 <****> sutabi: maybe a fatal error...
00:18 <****> should i edit all my <? tags to something , or there s another reason ?
00:19 <****> AlReece45: how do I throw a fetal error?
00:19 <****> undefined_function(); would do the trick, but how hacky ;)
00:19 <****> lol
00:19 <****> hm...
00:19 <****> sutabi: i think you need to rethink what goes in your destructor
00:19 <****> simply issue a E_USER_ERROR using trigger_error ?
00:20 <****> Can PHP read / get POP, IMAP or any mail? Senario: there is a system that triggers an email. I want to make a system that does something when this email is recieved
00:20 <****> php.net/imap
00:20 <****> ekneuss: slightly neater but equally hacky ;)
00:20 <****> sutabi: I agree with arpad, the destructor is just supposed do clean up, you shouldn't expect it not to run when the object is destroyed.
00:21 <****> destructors are quite limitted, especially when triggered during shutdown, you should keep their work simple
00:21 <****>.< I have it render a template when it is grrr
00:22 <****> if im inside a function, is there a function that tells me the name of the function im in?
00:22 <****> __FUNCTION__
00:22 <****> __FUNCTION__ constant
00:22 <****> magical constant :)
00:22 <****> dats not getin deprecated is it =x
00:23 <****> dats what i hate about constants, sometime or later, they get deprecated
00:23 <****> o.O
00:23 <****> very unlikely
00:23 <****> You know... arpad that might grow on me :P http://knightsoftemplar.info/forum/topic/186?p=0#topic_187 <3 fetal errors
00:24 <****> sutabi: good work :p
00:24 <****> what's the point anyway ?
00:24 <****>.<
00:24 <****> I could do a redirect
00:24 <****> but too lazy to make a new page
00:25 <****> why not just output something different?
00:25 <****> like, shockingly perhaps, an error message
00:25 <****> :)
00:26 <****>.<
00:27 <****> What would be the best way to monitor out going requests/connection by php?
00:27 <****> You don't have permission to access /php5-cgi/~orogor/phpinfo.php5 on this server.
Total 41 pages. You are browsing page 1/41.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
