I found this code...
if (version_compare(PHP_VERSION, '5.2.0', '>=')) {
$text=filter_var($text, FILTER_SANITIZE_URL);
}
...to be questionable.
Under what conditions would version_compare() return true, yet the filter_var()
be undefined? Because that's what is happening.
Thank you.
--
PHP
>Personally, I would change that to be
>if ( function_exists('filter_var') ) {
So would I:
*But it's not my code.
*I wish to learn and understand the cause of the problem - not walk around it.
>It means condition (PHP_VERSION >= 5.2.0)
I understand that. There was a second, more relevant, part
>As Paul pointed out, maybe your version of PHP was built without the
>filter_var function compiled in.
This is what I have learned about PHP with filter_var() as an illustrative
point:
Many people who provide elaborations on PHP make too many assumptions or are
blatently and woefully incomple
I am running into a variable collision. The project I'm developing is NOT
guaranteed to be operating on PHP5. Any solution I find should (hopefully) be
able to run on PHP4 (yes, I know PHP4 is deprecated).
I am building a bridge between two third-party applications. Both instantiate
their respe
>Just to clarify, both packages are instantiating and calling their
>respective classes from the $db var, which is in the global scope.
>Is this correct?
I would say yes to the way you are asking. Take the following two applications.
The four respective statements are in each their respective sc
Gentlemen,
Thank you. The "Thing1 Thing2" approach worked.
>If you have total control over application A which contains the bridge
>code, the easiest is to change it to use a different global variable.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.n
PHP 5.4.4-TS-VC9 on Windows XP SP3 NTFS non-system drive with 18GB free.
I dare not try to replicate this. As such, I cannot firmly place the blame on
PHP.
I have peppered a PHP application with a call to a function which appends-only
to a logfile the parameters passed to it. Each pass of the a
"If you can show the write portion of the code in your iteration,
as well as a sample of the naming convention, it may offer more clues."
$dbgMsg = "a diagnostic string maybe 5K in length";
$dbg_fp = fopen(ROOT_DIR.DS."dbg_log.txt", "a"); // Derives a full path
fwrite($dbg_fp, $dbgMsg);
fclose($db
I'm curious to know what the lifetime of a constant is.
I know that sounds like a stupid question, but the context is this:
I have a file I am writing to up to the very last possible micro-second. As
such, I know that as PHP is destroying itself after having executed the last
statement in the p
I have an application running under PHP-5.4.17-TS-VC9 (and .14 as of yesterday)
with Aprelium's Abyss X1 v2.8 web server in FastCGI mode on WinXPSP3.
An earlier version of this application works. The current version causes a 500
Internal Server Error. There is no entry in PHP's (fully active) er
>It looks like you are running the thread-safe version with
>FastCGI, which I understand to be counter to the recommendations.
Thank you for the comment.
I switched to PHP5.4.17-NTS-VC9, but the application still crashes. And still
no clue as to why.
So, still looking for that magic method to g
>Have you got all your extensions updated?
I would think so. Just to state the required disclaimers:
phpinfo.php with works.
Liberally peppering a tracer routine throughout the application shows it is
getting executed up until one spot. But there is nothing obviously wrong with
the code. Nothin
I have a situation where, for some unknown reason, where each class that
finishes its __contruct{} function, that class gets automatically assigned to a
variable - other than the variable I specify.
Conceptually:
class Hello { private $_world = 'World'; __construct(){} }
$clsHello = new Hello(
Second go around:
I have a situation where, for some unknown reason, where each class that
finishes its __contruct{} function, that class gets automatically assigned to a
variable - other than the variable I specify.
Conceptually (a little bit better on the conceptualizing):
class Hello {
priv
>I cannot replicate this.
I don't expect anyone to be able to replicate this behavior. The example shows
an extraordinarily stripped-down sequence of statements that informs what
should work, but do to some unknown agent, which, therefore, cannot be included
in the example, produces unexpected
> $hello = $clsHello;
If that conceptual statement (or any occurance of the conceptual $hello) were
in the code, then my (really good) Find feature of my code editor would have
found it.
> There are only a few variables that get assigned as side effects of
> functions, but they have very spe
>Your example does _not_ show this, it works
>as expected and throws a notice, from which can be inferred there is other
>code doing this
Or relevant code having a side-effect not currently realized.
>Is your class maybe inheriting from another one and that contains the code
>causing this issue?
The following works (three parents):
include("../../../includes/ini.inc.php");
require_once("../../../includes/ini.inc.php");
The following works (four parents):
include("../../../../includes/ini.inc.php");
The following does not work (four parents):
require_once("../../../../includes/ini.inc.ph
With all kind respect to Richard Buskirk and Daniel Brown (thank you for
responding), their replies did not actually answer my question.
My question is: What module or php.ini setting would render inoperative a
directory traversal of X parents?
My original post follows.
The following works (th
A client has:
PHP 5.3 on Win7x64 running a local web app that needs to send mail. (This app
was once hosted on a linux-based hosted space.) Apache 2.2 is installed but
apparently not being used. I think the IIS service is actually the web server
that is engaged.
During troubleshooting a wide ra
>>Instead of 'auth'=> true, I used 'auth' => "PLAIN" as
>> suggested by a user comment on the Mail documentation page.)
$obj = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password));
(Variables are set.
I have a script that accepts four POST variables. Three are used and five more
are added for a total of eight keys and their urlencode() values all strung
together in the proper format.
Then cURL is initialized with the field string given to:
curl_setopt($ch, CURLOPT_POST,8);
curl_setopt($ch, CU
I've done a site from Classic ASP (no .net) to non-oop PHP.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
23 matches
Mail list logo