@@ -42,14 +42,18 @@ function in_arrayi($needle, $haystack){
4242}
4343
4444// regular array_merge does not work if arrays have numeric keys...
45- function array_merge_custom ()
46- {
47- $ array = array ();
48- $ arguments = func_get_args ();
49- foreach ($ arguments as $ args )
50- foreach ($ args as $ key => $ value )
51- $ array [$ key ] = $ value ;
52- return $ array ;
45+ function array_merge_custom (){
46+
47+ $ arr = array ();
48+ $ args = func_get_args ();
49+
50+ foreach ( (array )$ args as $ arg ){
51+ foreach ( (array )$ arg as $ key => $ value ){
52+ $ arr [$ key ] = $ value ;
53+ }
54+ }
55+
56+ return $ arr ;
5357}
5458
5559// rotate each string character based on corresponding ascii values from some key
@@ -208,72 +212,6 @@ function vid_player($url, $width, $height, $extension = false){
208212 return $ html ;
209213}
210214
211- function element_find ($ id , $ html ){
212-
213- if (preg_match ('/<(\w+)[^>]+id=" ' .$ id .'"/is ' , $ html , $ matches , PREG_OFFSET_CAPTURE )){
214-
215- $ element_start = $ matches [0 ][1 ];
216- $ element_end = 0 ;
217-
218- // tag stuff
219- $ tag_name = $ matches [1 ][0 ];
220- $ tag_len = strlen ($ tag_name );
221-
222- $ run_count = 300 ;
223- $ start = $ element_start ;
224-
225- // "unclosed" <tag elements we found so far...
226- $ open_count = 0 ;
227-
228- while ($ run_count > 0 ){
229-
230- $ open_tag = strpos ($ html , "< {$ tag_name }" , $ start );
231- $ close_tag = strpos ($ html , "</ {$ tag_name }" , $ start );
232-
233- // we encountered the start of another tag...
234- if ($ open_tag < $ close_tag ){
235- $ open_count ++;
236- $ start = $ open_tag + $ tag_len + 1 ;
237- // we encountered a closed tag first
238- } else if ($ close_tag < $ open_tag ){
239- $ open_count --;
240- $ start = $ close_tag + $ tag_len + 2 ;
241- }
242-
243- if ($ open_count == 0 ){
244- $ element_end = $ close_tag + $ tag_len + 3 ;
245- break ;
246- }
247-
248- $ run_count --;
249- }
250-
251- // something went wrong... don't bother returning anything
252- if ($ run_count == 0 ){
253- return false ;
254- }
255-
256- return array ($ element_start , $ element_end );
257- }
258-
259- return false ;
260- }
261-
262- function element_remove ($ id , $ html ){
263-
264- $ arr = element_find ($ id , $ html );
265-
266- if ($ arr ){
267- return str_remove ($ html , $ arr [0 ], $ arr [1 ]);
268- }
269-
270- return $ html ;
271- }
272-
273- function str_remove ($ str , $ start , $ end ){
274- return substr_replace ($ str , "" , $ start , $ end -$ start );
275- }
276-
277215function rel2abs ($ rel , $ base )
278216{
279217 if (strpos ($ rel , "// " ) === 0 ) {
0 commit comments