Skip to content

Instantly share code, notes, and snippets.

View yohgaki's full-sized avatar

Yasuo Ohgaki yohgaki

View GitHub Profile
@yohgaki
yohgaki / php-5.6-url-rewriter.patch
Last active August 10, 2016 20:08
URL rewriter
diff --git a/ext/standard/tests/general_functions/url_rewriter.phpt b/ext/standard/tests/general_functions/url_rewriter.phpt
new file mode 100644
index 0000000..ce91b27
--- /dev/null
+++ b/ext/standard/tests/general_functions/url_rewriter.phpt
@@ -0,0 +1,139 @@
+--TEST--
+URL Rewriter tests
+--INI--
+url_rewriter.tags="a=href,form="
diff --git a/UPGRADING b/UPGRADING
index 5400a2e..56221f4 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -71,6 +71,25 @@ PHP 7.1 UPGRADE NOTES
- OpenSSL:
. Dropped sslv2 stream.
+- Session:
+ . Session ID is generated from CSPNG directly. As a result, Session ID length
diff --git a/ext/standard/tests/general_functions/url_rewriter.phpt b/ext/standard/tests/general_functions/url_rewriter.phpt
new file mode 100644
index 0000000..ce91b27
--- /dev/null
+++ b/ext/standard/tests/general_functions/url_rewriter.phpt
@@ -0,0 +1,139 @@
+--TEST--
+URL Rewriter tests
+--INI--
+url_rewriter.tags="a=href,form="
diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c
index 311d6aa..cad8137 100644
--- a/ext/wddx/wddx.c
+++ b/ext/wddx/wddx.c
@@ -836,6 +836,7 @@ static void php_wddx_push_element(void *user_data, const XML_Char *name, const X
if (atts) for (i = 0; atts[i]; i++) {
if (!strcmp(atts[i], EL_NAME) && atts[++i] && atts[i][0]) {
+ if (stack->varname) efree(stack->varname);
stack->varname = estrdup(atts[i]);
@yohgaki
yohgaki / rand.c.diff
Last active May 13, 2016 05:44
mt_rand/rand should raise error exceeds getrandmax() value
diff --git a/ext/standard/rand.c b/ext/standard/rand.c
index 50729f2..38c405d 100644
--- a/ext/standard/rand.c
+++ b/ext/standard/rand.c
@@ -293,8 +293,16 @@ PHP_FUNCTION(rand)
zend_long number;
int argc = ZEND_NUM_ARGS();
- if (argc != 0 && zend_parse_parameters(argc, "ll", &min, &max) == FAILURE)
- return;
@yohgaki
yohgaki / session.c.diff
Last active January 28, 2016 23:14
Work around for PHP7
diff --git a/ext/session/session.c b/ext/session/session.c
index fc91eda..3dec117 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -2089,7 +2089,7 @@ static PHP_FUNCTION(session_regenerate_id)
RETURN_FALSE;
}
}
- PS(mod)->s_close(&PS(mod_data));
+ /* PS(mod)->s_close(&PS(mod_data)); */
@yohgaki
yohgaki / session.c.diff
Created January 27, 2016 06:42
Session unit test fix
diff --git a/ext/session/session.c b/ext/session/session.c
index c3ea950..867d78e 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -538,9 +538,6 @@ static void php_session_initialize(TSRMLS_D) /* {{{ */
php_session_reset_id(TSRMLS_C);
}
- /* GC must be done before read */
- php_session_gc(TSRMLS_C);
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index ea6ac1a..c8784b1 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -220,21 +220,55 @@ static char _generic_superset_name[] = ICONV_UCS4_ENCODING;
#define GENERIC_SUPERSET_NBYTES 4
/* }}} */
-static PHP_INI_MH(OnUpdateStringIconvCharset)
+
@yohgaki
yohgaki / php-5.3-addslshes-mblen
Last active January 1, 2016 14:09
Add mblen support to addslashes.
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 907301d..3d5b7a2 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -3248,7 +3248,7 @@ PHPAPI char *php_addslashes_ex(char *str, int length, int *new_length, int shoul
char *source, *target;
char *end;
int local_new_length;
-
+
@yohgaki
yohgaki / gist:7441034
Created November 13, 2013 00:00
Patch adds rpm build script to casperjs-master.
diff --git a/rpm/build b/rpm/build
new file mode 100755
index 0000000..de73e32
--- /dev/null
+++ b/rpm/build
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# A silly little helper script to build the RPM.
+set -e