1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 09:28:21 +02:00
Commit Graph

1106 Commits

Author SHA1 Message Date
Sascha Schumann 3ee228371d Let strtr() use smart_str to reduce complexity 2000-10-12 01:26:26 +00:00
Sascha Schumann 174253123e Rewrite php_str_to_str using the smart_str API.
This removes much complexity from the function.

Speed is improved by pre-allocating memory instead of reallocating
the buffer each time the pattern is found.
2000-10-12 00:50:28 +00:00
Sascha Schumann 82d199b639 Move structure definition into its own file, so that public header
files don't need to include the complete source code.
2000-10-12 00:48:12 +00:00
Hartmut Holzgraefe f2ddc10685 proto typo fixes 2000-10-11 13:51:32 +00:00
Hartmut Holzgraefe 332b7125de added missing protos 2000-10-11 11:40:29 +00:00
Hartmut Holzgraefe be19c812ab added some missing protos 2000-10-11 11:25:13 +00:00
Sascha Schumann 5674f1be45 Ignore close tags and use unsigned char type. 2000-10-04 18:06:20 +00:00
Andi Gutmans a1abfb7643 - Fix dirname() 2000-10-03 16:47:25 +00:00
Andi Gutmans d37b140601 - Fix VC++ warning 2000-10-03 14:43:04 +00:00
Andi Gutmans bf7603cf83 - Now really fix it. 2000-10-02 18:13:53 +00:00
Andi Gutmans 28c96e89e1 - Fix bug in parse_url() 2000-10-02 17:51:30 +00:00
Andi Gutmans 2622eba31d - Cleanup some output functions 2000-09-30 16:13:48 +00:00
Sascha Schumann 4b89b67d1c Don't try to serialize references.
Circular references would otherwise kill PHP, as the serializer
would overrun the stack.
2000-09-29 18:48:40 +00:00
Sascha Schumann 2e4ab68995 Automatic conversion might cause interpretation of 0xff as EOF, so we store
the result in an object of type int first.

Submitted by: melchers@cis.fu-berlin.de
2000-09-27 16:08:26 +00:00
Sascha Schumann 3823ad3ec0 Recognize single quotes around cdata.
Move smart_str functions to an extra file.
2000-09-27 15:26:39 +00:00
Sascha Schumann 1cc3e6b5e6 Move php_memnstr to the header file, so that the function body is available
in all compilation units (note the static linkage).
2000-09-27 15:18:00 +00:00
Sascha Schumann 7db874096e Unify memory allocation in smart_str functions 2000-09-26 11:00:39 +00:00
Stig Venaas 9a9e2e72b0 Small fix to the literal IPv6 parsing, now stops at first ] after [ 2000-09-22 00:33:55 +00:00
Stig Venaas 0776f7d3d7 Parsing of URLs with literal IPv6 addresses, see RFC 2732
@- IPv6 support in fopen (one can access IPv6 ftp/web servers) (Stig Venaas)
2000-09-22 00:12:00 +00:00
Sascha Schumann 854c0622f0 Cleanup SCANNER_DEBUG and don't NUL terminate work buffer 2000-09-20 08:59:52 +00:00
Sascha Schumann cfa22547e0 Use emalloc and friends. Since we reuse all buffers, this does not affect
the speed.

The smart_str_* functions don't NUL terminate strings anymore. We can
rely on the length of the strings completely.
2000-09-20 08:40:33 +00:00
Sascha Schumann 16d7cb88fa Remove this pseudo optimization from the previous rewrite.
Since we leave/enter the loop more often, the cost of maintaining
c_arg/c_val is higher than simply copying the tag/arg string once.
2000-09-20 08:13:45 +00:00
Sascha Schumann f27f790f29 Another 5%-10% speed increase achieved by
- making ctx->val read-only
- adding a special appendc function for appending single characters
2000-09-20 08:06:01 +00:00
Sascha Schumann 7aa23d3ca3 Add support for URLs containing NAME info (for scrolling; #name). 2000-09-20 02:04:19 +00:00
Sascha Schumann cd9ab22f84 Rename prototype to currently used name. These stupid names will go away once
the transition periode ends.
2000-09-20 01:25:19 +00:00
Sascha Schumann a2dc8a2fa5 2nd Rewrite of the main scanner engine. This version is cleaner and faster.
It handles the following tags currently:

<FRAME .. SRC=URL ..>
<INPUT .. TYPE=IMAGE SRC=URL ..>
<A     .. HREF=URL ..>
<AREA  .. HREF=URL ..>
<IMG   .. SRC=URL ..>

Additional ones can be added within seconds.

The support for HTML forms has been significantly improved. The scanner
will now add proper Hidden Fields for the Session ID.
2000-09-20 01:15:10 +00:00
Sascha Schumann cc53ad5166 Reduce the amount of copying in the mainloop. We copy tag/arg only, if we
need to preserve them for a new loop iteration (after we leave mainloop).
Otherwise, we can just let them point to the work area.
2000-09-19 20:19:03 +00:00
Sascha Schumann dd59d14805 Revert part of last commit. I'll refine it later. 2000-09-19 19:18:41 +00:00
Andi Gutmans c54047b0b0 - Change to Z_BVAL macro 2000-09-19 18:19:02 +00:00
Sascha Schumann a7ef1966ac Another speedup by avoiding string copies.
15% speed gain in test case (rewriting 1M URLs).
2000-09-19 18:17:28 +00:00
Sascha Schumann 95ae21ff1b Remove nextiter label 2000-09-19 18:01:29 +00:00
Sascha Schumann 7f86b7224c s/DEBUG/SCANNER_DEBUG/. "Convert" one macro to inline function to be more
consistent. Also use continue.
2000-09-19 18:00:58 +00:00
Zeev Suraski 5b0ca1585a Fix a few build bugs, still no go 2000-09-19 17:53:09 +00:00
Sascha Schumann e07e19f271 The rewrite was completely authored by Hartmut 2000-09-19 17:45:44 +00:00
Sascha Schumann e2efb3cf06 Remove unnecessary include directive 2000-09-19 17:39:43 +00:00
Zeev Suraski c45b1c2c8b - Fix warnings
- Fix URL scanner startup crash
2000-09-19 17:37:34 +00:00
Sascha Schumann 4b3fb7b05e Add new URL scanner. This version is up to 20% faster. It will be
enabled by default once I'm sure that it works in every case.

To enable it, apply s/url_adapt_ext/url_adapt_ext_ex/ to session.c
2000-09-19 17:32:27 +00:00
Sascha Schumann e986a4b0a3 Fix RINIT/RSHUTDOWN functions and add url_adapt_ext() 2000-09-19 17:21:26 +00:00
Stanislav Malyshev 08e1c852aa Fix decbin 2000-09-17 21:11:55 +00:00
Stanislav Malyshev 27fb7df0d2 Add empty string checks to add?slashes 2000-09-17 09:15:48 +00:00
Zak Greant e9d946d374 Thought that I had just committed something really stupid.
On closer inspection, realized that the proto comments
for chown and chgrp were reversed. :)
I did not realize this and had only fixed chown previously
2000-09-16 05:10:03 +00:00
Zak Greant e7b0cd7ad2 trivial change
corrected mistake in proto comment for chown fold
2000-09-16 05:02:06 +00:00
Zeev Suraski 6c3d7449e1 - Made eval() and several other runtime-evaluated code portions report the
nature and location of errors more accurately (Stas)
2000-09-12 20:48:33 +00:00
Andrei Zmievski 5470222d70 Forgot to update proto. 2000-09-12 19:04:50 +00:00
Andrei Zmievski 34574352be @- Added second argument to array_reverse() that indicatese whether
@  the original array keys should be preserved. (Andrei)
2000-09-12 19:03:59 +00:00
Daniel Beckham b852f3941f reversed chomp alias addition as per Andi Gutmans' request 2000-09-12 19:00:21 +00:00
Rasmus Lerdorf 75d73aaffb # missed proto comments 2000-09-12 17:24:46 +00:00
Rasmus Lerdorf d23ad61dc3 Clean up htmlspecialchars/htmlentities inconsistencies.
@Clean up htmlspecialchars/htmlentities inconsistencies. (Rasmus)
2000-09-12 17:22:37 +00:00
Daniel Beckham 5925071957 added chomp() alias for chop() for us Perl purists. 2000-09-12 15:54:10 +00:00
Stanislav Malyshev 44e04f7688 Make parse_str always register globals with 1 argument and never -
with 2 arguments
2000-09-12 10:56:25 +00:00