Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4261
Latest: live627
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43353
Total Topics: 7534
Most Online Today: 146
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 124
Total: 124

Author Topic: JSON decode error: The maximum stack depth has been exceeded  (Read 609 times)

0 Members and 1 Guest are viewing this topic.

Offline Randem

  • Member
  • *
  • Posts: 11
    • View Profile
Hi we are getting this message constantly in SMF 2.1.4 with Apache 2.4 and PHP 8.2.

This is the error line in SMF (Load.php):




Here is the back trace information that causes the error.

« Last Edit: June 14, 2024, 08:54:54 pm by Randem »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16481
    • View Profile
Re: JSON decode error: The maximum stack depth has been exceeded
« Reply #1 on: June 14, 2024, 09:13:46 pm »
Are you using latest version.
Also check if your PrettyUrls.Filter.php has this code

Code: [Select]
// Rewrite the buffer with Pretty URLs!
function pretty_rewrite_buffer($buffer)
{
global $boardurl, $context, $modSettings, $smcFunc;

if (isset($_REQUEST['action']))
{
if ($_REQUEST['action'] == 'post2')
return $buffer;

if ($_REQUEST['action'] == 'profile'  && isset($_REQUEST['area']) && $_REQUEST['area'] == 'alerts_popup')
return $buffer;
}
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Randem

  • Member
  • *
  • Posts: 11
    • View Profile
Re: JSON decode error: The maximum stack depth has been exceeded
« Reply #2 on: June 14, 2024, 09:48:45 pm »
Hi,

I am using version 4.0.1 my PrettyUrls.Filter.php file has the following code:
Code: [Select]

function pretty_rewrite_buffer($buffer)
{
    global $boardurl, $context, $modSettings, $smcFunc;

    if (isset($_REQUEST['action']))
    {
        if ($_REQUEST['action'] == 'post2')
        return $buffer;
    }

    if (!empty($modSettings['pretty_bufferusecache']))
    {
        $buffer = pretty_rewrite_buffer_fromcache($buffer);
        return $buffer;
    }

the file is found in the SMF2-1 folder.
« Last Edit: June 14, 2024, 09:51:45 pm by Randem »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16481
    • View Profile
Re: JSON decode error: The maximum stack depth has been exceeded
« Reply #3 on: June 14, 2024, 09:58:39 pm »
Try using this code
Code: [Select]
<?php
// Version: 1.0; PrettyUrls-Filters
// A file for filter extensions to be placed in

if (!defined('SMF'))
die('Hacking attempt...');

// Rewrite the buffer with Pretty URLs!
function pretty_rewrite_buffer($buffer)
{
global $boardurl$context$modSettings$smcFunc;

if (isset($_REQUEST['action']))
{
if ($_REQUEST['action'] == 'post2')
return $buffer;

if ($_REQUEST['action'] == 'profile'  && isset($_REQUEST['area']) && $_REQUEST['area'] == 'alerts_popup')
return $buffer;
}

if (!empty($modSettings['pretty_bufferusecache']))
{
$buffer pretty_rewrite_buffer_fromcache($buffer);
return $buffer;
}


// Remove the script tags now
$context['pretty']['scriptID'] = 0;
$context['pretty']['scripts'] = array();
$buffer preg_replace_callback('~<script.+?</script>~s''pretty_scripts_remove'$buffer);


if (empty($context['session_var']))
$context['session_var'] = substr(preg_replace('~^\d+~'''sha1($smcFunc['random_int']() . session_id() . $smcFunc['random_int']())), 0$smcFunc['random_int'](712));

// Find all URLs in the buffer
$context['pretty']['search_patterns'][] = '~(<a[^>]+href=|<link[^>]+href=|<form[^>]+?action=)(\"[^\"#]+|\'[^\'#]+)~';
$urls_query = array();
$uncached_urls = array();
foreach ($context['pretty']['search_patterns'] as $pattern)
{
preg_match_all($pattern$buffer$matchesPREG_PATTERN_ORDER);
foreach ($matches[2] as $match)
{



// Rip out everything that shouldn't be cached
$match preg_replace(array('~^[\"\']|PHPSESSID=[^;]+|(se)?sc=[^;]+|' $context['session_var'] . '=[^;]+~''~\"~''~;+|=;~''~\?;~''~\?$|;$|=$~'), array('''%22'';''?'''), $match);

// Absolutise relative URLs
if (!preg_match('~^[a-zA-Z\-]+:|^#|@~'$match) && SMF != 'SSI')
$match $boardurl '/' $match;

// Replace $boardurl with something a little shorter
$url_id str_replace($boardurl'`B'$match);

if (substr($url_id,0,7) == 'mailto:')
continue;
if (substr($url_id,0,10) == 'javascript')
continue;

if (substr($url_id,0,11) == 'android-app')
continue;

if (substr($url_id,0,7) == 'ios-app')
continue;

if (substr($url_id,0,7) == 'http://')
continue;

if (substr($url_id,0,8) == 'https://')
continue;

// Skip any other ursl
$urls_query[] = $url_id;
$uncached_urls[$url_id] = array(
'url' => $match,
'url_id' => $url_id
);
}
}

// Proceed only if there are actually URLs in the page
if (count($urls_query) != 0)
{
$urls_query array_keys(array_flip($urls_query));
// Retrieve cached URLs
$context['pretty']['cached_urls'] = array();
$query $smcFunc['db_query']('''
SELECT url_id, replacement
FROM {db_prefix}pretty_urls_cache
WHERE url_id IN ({array_string:urls})'
,
array('urls' => $urls_query));
while ($row $smcFunc['db_fetch_assoc']($query))
{
// Put the full $boardurl back in
$context['pretty']['cached_urls'][$row['url_id']] = str_replace('`B'$boardurl$row['replacement']);
unset($uncached_urls[$row['url_id']]);
}
$smcFunc['db_free_result']($query);

// If there are any uncached URLs, process them
if (count($uncached_urls) != 0)
{
// Run each filter callback function on each URL
$filter_callbacks unserialize($modSettings['pretty_filter_callbacks']);
foreach ($filter_callbacks as $callback)
$uncached_urls call_user_func($callback$uncached_urls);

// Fill the cached URLs array
$cache_data = array();
foreach ($uncached_urls as $url_id => $url)
{
if (!isset($url['replacement']))
$url['replacement'] = $url['url'];
$url['replacement'] = str_replace("\x12"'\''$url['replacement']);
$url['replacement'] = preg_replace(array('~\"~''~;+|=;~''~\?;~''~\?$|;$|=$~'), array('%22'';''?'''), $url['replacement']);
$context['pretty']['cached_urls'][$url_id] = $url['replacement'];

// Cache only the URLs which will fit, but replace $boardurl first, that will help!
if (strlen($url_id) < 256 && strlen($url['replacement']) < 256)
$cache_data[] = array($url_idstr_replace($boardurl'`B'$url['replacement']));
}

// Cache these URLs in the database
if (count($cache_data) != 0)
$smcFunc['db_insert']('replace',
'{db_prefix}pretty_urls_cache',
array('url_id' => 'string''replacement' => 'string'),
$cache_data,
array('url_id'));
}

// Put the URLs back into the buffer
$context['pretty']['replace_patterns'][] = '~(<a[^>]+href=|<link[^>]+href=|<form[^>]+?action=)(\"[^\"]+\"|\'[^\']+\')~';
foreach ($context['pretty']['replace_patterns'] as $pattern)
$buffer preg_replace_callback($pattern'pretty_buffer_callback'$buffer);


$buffer str_replace('javascript:self.close()"','javascript:self.close();"',$buffer);
}

// Restore the script tags
if ($context['pretty']['scriptID'] > 0)
$buffer preg_replace_callback("~\x14([0-9]+)\x14~"'pretty_scripts_restore'$buffer);

// Return the changed buffer.
return $buffer;
}

function 
pretty_rewrite_buffer_fromcache($buffer)
{
global $boardurl$context$modSettings$smcFunc;

// Function by nend
// http://www.simplemachines.org/community/index.php?topic=146969.msg3277889#msg3277889



// Remove the script tags now
$context['pretty']['scriptID'] = 0;
$context['pretty']['scripts'] = array();
$buffer preg_replace_callback('~<script.+?</script>~s''pretty_scripts_remove'$buffer);

if (empty($context['session_var']))
$context['session_var'] = substr(preg_replace('~^\d+~'''sha1($smcFunc['random_int']() . session_id() . $smcFunc['random_int']())), 0$smcFunc['random_int'](712));


// Find all URLs in the buffer
$context['pretty']['search_patterns'][] = '~(<a[^>]+href=|<link[^>]+href=|<form[^>]+?action=)(\"[^\"#]+|\'[^\'#]+)~';
$urls_query = array();
$uncached_urls = array();
foreach ($context['pretty']['search_patterns'] as $pattern)
{
preg_match_all($pattern$buffer$matchesPREG_PATTERN_ORDER);
foreach ($matches[2] as $match)
{



// Rip out everything that shouldn't be cached
$match preg_replace(array('~^[\"\']|PHPSESSID=[^;]+|(se)?sc=[^;]+|' $context['session_var'] . '=[^;]+~''~\"~''~;+|=;~''~\?;~''~\?$|;$|=$~'), array('''%22'';''?'''), $match);

// Absolutise relative URLs
if (!preg_match('~^[a-zA-Z\-]+:|^#|@~'$match) && SMF != 'SSI')
$match $boardurl '/' $match;

// Replace $boardurl with something a little shorter
$url_id str_replace($boardurl'`B'$match);

if (substr($url_id,0,7) == 'mailto:')
continue;
if (substr($url_id,0,10) == 'javascript')
continue;

if (substr($url_id,0,11) == 'android-app')
continue;

if (substr($url_id,0,7) == 'ios-app')
continue;

if (substr($url_id,0,7) == 'http://')
continue;

if (substr($url_id,0,8) == 'https://')
continue;

$urls_query[] = $url_id;
$uncached_urls[$url_id] = array(
'url' => $match,
'url_id' => $url_id
);
}
}

// Proceed only if there are actually URLs in the page
if (count($urls_query) != 0)
{
$urls_query array_keys(array_flip($urls_query));
// Retrieve cached URLs
$context['pretty']['cached_urls'] = array();

// Load file cache
$cache_data = array(); //moved this to merge, can just use the cached urls context but this will do for now.
if (($data cache_get_data(strtr('pretty-'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"],'/' ,'--'))) != null) {
foreach($data as $id => $url) {
$context['pretty']['cached_urls'][$id] = $url;
$cache_data[] = array($id$url);
unset($uncached_urls[$id]);
}
}

// If there are any uncached URLs, process them
if (count($uncached_urls) != 0)
{
// Run each filter callback function on each URL
$filter_callbacks unserialize($modSettings['pretty_filter_callbacks']);
foreach ($filter_callbacks as $callback)
$uncached_urls call_user_func($callback$uncached_urls);

// Fill the cached URLs array
// $cache_data = array();
foreach ($uncached_urls as $url_id => $url)
{
if (!isset($url['replacement']))
$url['replacement'] = $url['url'];
$url['replacement'] = str_replace("\x12"'\''$url['replacement']);
$url['replacement'] = preg_replace(array('~\"~''~;+|=;~''~\?;~''~\?$|;$|=$~'), array('%22'';''?'''), $url['replacement']);
$context['pretty']['cached_urls'][$url_id] = $url['replacement'];

// Cache only the URLs which will fit, but replace $boardurl first, that will help!
// if (strlen($url_id) < 256 && strlen($url['replacement']) < 256 && stristr($url['replacement'], $boardurl))
// $cache_data[] = array($url_id, str_replace($boardurl, '`B', $url['replacement']));
$cache_data[] = array($url_id$url['replacement']);
}


// File based caching
if (count($cache_data) != 0)
cache_put_data(strtr('pretty-'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"],'/' ,'--'), $cache_data);
}

// Put the URLs back into the buffer
$context['pretty']['replace_patterns'][] = '~(<a[^>]+href=|<link[^>]+href=|<form[^>]+?action=)(\"[^\"]+\"|\'[^\']+\')~';
foreach ($context['pretty']['replace_patterns'] as $pattern)
$buffer preg_replace_callback($pattern'pretty_buffer_callback'$buffer);

$buffer str_replace('javascript:self.close()"','javascript:self.close();"',$buffer);
}

// Restore the script tags
if ($context['pretty']['scriptID'] > 0)
$buffer preg_replace_callback("~\x14([0-9]+)\x14~"'pretty_scripts_restore'$buffer);

// Return the changed buffer.
return $buffer;
}

// Remove and save script tags
function pretty_scripts_remove($match)
{
global $context;

$context['pretty']['scriptID']++;
$context['pretty']['scripts'][$context['pretty']['scriptID']] = $match[0];
return "\x14" $context['pretty']['scriptID'] . "\x14";
}

// A callback function to replace the buffer's URLs with their cached URLs
function pretty_buffer_callback($matches)
{
global $boardurl$context$smcFunc;

// Is this URL in an attribute, and so will need new quotes?
$addQuotes preg_match('~^[\"\']~'$matches[2]);

// Remove those annoying quotes
$matches[2] = preg_replace('~^[\"\']|[\"\']$~'''$matches[2]);

if (empty($context['session_var']))
$context['session_var'] = substr(preg_replace('~^\d+~'''sha1($smcFunc['random_int']() . session_id() . $smcFunc['random_int']())), 0$smcFunc['random_int'](712));

// Store the parts of the URL that won't be cached so they can be inserted later
preg_match('~PHPSESSID=[^;#&]+~'$matches[2], $PHPSESSID);
preg_match('~(se)?sc=[^;#]+~'$matches[2], $sesc);
preg_match('~' $context['session_var'] . '=[^;#]+~'$matches[2], $session_var);
preg_match('~#.*~'$matches[2], $fragment);

// Rip out everything that won't have been cached
$cacheableurl preg_replace(array('~PHPSESSID=[^;#]+|(se)?sc=[^;#]+|' $context['session_var'] . '=[^;#]+|#.*$~''~\"~''~;+|=;~''~\?;~''~\?$|;$|=$~'), array('''%22'';''?'''), $matches[2]);

// Absolutise relative URLs
if (!preg_match('~^[a-zA-Z]+:|@~'$cacheableurl) && !($cacheableurl == '' && isset($fragment[0])) && SMF != 'SSI')
$cacheableurl $boardurl '/' $cacheableurl;

// Replace $boardurl with something a little shorter
$url_id str_replace($boardurl'`B'$cacheableurl);

// Stitch everything back together, clean it up and return
$replacement = isset($context['pretty']['cached_urls'][$url_id]) ? $context['pretty']['cached_urls'][$url_id] : $cacheableurl;
$replacement .= (strpos($replacement'?') === false '?' ';') . (isset($PHPSESSID[0]) ? $PHPSESSID[0] : '') . ';' . (isset($sesc[0]) ? $sesc[0] : '') . (isset($session_var[0]) ? $session_var[0] : '') . (isset($fragment[0]) ? $fragment[0] : '');
$replacement preg_replace(array('~;+|=;~''~\?;~''~\?#|;#|=#~''~\?$|&amp;$|;$|#$|=$~'), array(';''?''#'''), $replacement);
return $matches[1] . ($addQuotes '"' '') . $replacement . ($addQuotes '"' '');
}

// Put the script tags back
function pretty_scripts_restore($match)
{
global $context;

return $context['pretty']['scripts'][(int) $match[1]];
}

// Filter miscellaneous action urls
function pretty_urls_actions_filter($urls)
{
global $boardurl$context$modSettings$scripturl;

$skip_actions = array();
if (isset($modSettings['pretty_skipactions']))
$skip_actions explode(",",$modSettings['pretty_skipactions']);

$skip_actions[] = 'verificationcode';
$skip_actions[] = 'login';
$skip_actions[] = 'login2';
$skip_actions[] = 'logintfa';


$pattern '`' $scripturl '(.*)action=([^;]+)`S';
$replacement $boardurl '/$2/$1';
foreach ($urls as $url_id => $url)
if (!isset($url['replacement']))
if (preg_match($pattern$url['url'], $matches))
{
// Don't rewrite these actions
if (!empty($skip_actions))
if (in_array($matches[2],$skip_actions))
continue;

if (!empty($context['pretty']['action_array']))
if (in_array($matches[2], $context['pretty']['action_array']))
$urls[$url_id]['replacement'] = preg_replace($pattern$replacement$url['url']);
}
return $urls;
}

// Filter topic urls
function pretty_urls_topic_filter($urls)
{
global $context$modSettings$scripturl$smcFunc$sourcedir;

$pattern '`' $scripturl '(.*[?;&])topic=([.a-zA-Z0-9]+)(.*)`S';
$query_data = array();
foreach ($urls as $url_id => $url)
{
// Get the topic data ready to query the database with
if (!isset($url['replacement']))
if (preg_match($pattern$url['url'], $matches))
{
if (strpos($matches[2], '.') !== false)
list ($urls[$url_id]['topic_id'], $urls[$url_id]['start']) = explode('.'$matches[2]);
else
{
$urls[$url_id]['topic_id'] = $matches[2];
$urls[$url_id]['start'] = '0';
}
$urls[$url_id]['topic_id'] = (int) $urls[$url_id]['topic_id'];
$urls[$url_id]['match1'] = $matches[1];
$urls[$url_id]['match3'] = $matches[3];
$query_data[] = $urls[$url_id]['topic_id'];
}
}


    
// Fix for issue with non latin characters in topics if mysql default-character-set is not utf8
    
global $db_character_set;
    if (!empty(
$db_character_set))
        
$smcFunc['db_query']('set_character_set''
            SET NAMES ' 
$db_character_set,
            array()
        );

// Query the database with these topic IDs
if (count($query_data) != 0)
{
// Look for existing topic URLs
$query_data array_keys(array_flip($query_data));
$topicData = array();
$unpretty_topics = array();

$query $smcFunc['db_query']('''
SELECT t.id_topic, t.id_board, p.pretty_url
FROM {db_prefix}topics AS t
LEFT JOIN {db_prefix}pretty_topic_urls AS p ON (t.id_topic = p.id_topic)
WHERE t.id_topic IN ({array_int:topic_ids})'
,
array('topic_ids' => $query_data));

while ($row $smcFunc['db_fetch_assoc']($query))
if (isset($row['pretty_url']))
$topicData[$row['id_topic']] = array(
'pretty_board' => (isset($context['pretty']['board_urls'][$row['id_board']]) ? $context['pretty']['board_urls'][$row['id_board']] : $row['id_board']),
'pretty_url' => $row['pretty_url'],
);
else
$unpretty_topics[] = $row['id_topic'];
$smcFunc['db_free_result']($query);

// Generate new topic URLs if required
if (count($unpretty_topics) != 0)
{
require_once($sourcedir '/Subs-PrettyUrls.php');

// Get the topic subjects
$new_topics = array();
$new_urls = array();
$query_check = array();
$existing_urls = array();
$add_new = array();

$query $smcFunc['db_query']('''
SELECT t.id_topic, t.id_board, m.subject
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
WHERE t.id_topic IN ({array_int:topic_ids})'
,
array('topic_ids' => $unpretty_topics));

while ($row $smcFunc['db_fetch_assoc']($query))
$new_topics[] = array(
'id_topic' => $row['id_topic'],
'id_board' => $row['id_board'],
'subject' => $row['subject'],
);
$smcFunc['db_free_result']($query);

// Generate URLs for each new topic
foreach ($new_topics as $row)
{
$pretty_text substr(pretty_generate_url($row['subject']), 080);
// A topic in the recycle board doesn't deserve a proper URL
if (($modSettings['recycle_enable'] && $row['id_board'] == $modSettings['recycle_board']) || $pretty_text == '')
// Use 'tID_TOPIC' as a pretty url
$pretty_text 't' $row['id_topic'];
// No duplicates and no numerical URLs - that would just confuse everyone!
if (in_array($pretty_text$new_urls) || is_numeric($pretty_text))
// Add suffix '-ID_TOPIC' to the pretty url
$pretty_text substr($pretty_text070) . '-' $row['id_topic'];
$query_check[] = $pretty_text;
$new_urls[$row['id_topic']] = $pretty_text;
}

// Find any duplicates of existing URLs
            
if (!empty($query_check))
            {
    
$query $smcFunc['db_query']('''
     SELECT pretty_url
     FROM {db_prefix}pretty_topic_urls
     WHERE pretty_url IN ({array_string:new_urls})'
,
    
array('new_urls' => $query_check));
    
while ($row $smcFunc['db_fetch_assoc']($query))
    
$existing_urls[] = $row['pretty_url'];
    
$smcFunc['db_free_result']($query);
            }

// Finalise the new URLs ...
foreach ($new_topics as $row)
{
$pretty_text $new_urls[$row['id_topic']];
// Check if the new URL is already in use
if (in_array($pretty_text$existing_urls))
$pretty_text substr($pretty_text070) . '-' $row['id_topic'];
$add_new[] = array($row['id_topic'], $pretty_text);
// Add to the original array of topic URLs
$topicData[$row['id_topic']] = array(
'pretty_board' => (isset($context['pretty']['board_urls'][$row['id_board']]) ? $context['pretty']['board_urls'][$row['id_board']] : $row['id_board']),
'pretty_url' => $pretty_text,
);
}
// ... and add them to the database!
$smcFunc['db_insert']('ignore',
'{db_prefix}pretty_topic_urls',
array('id_topic' => 'int''pretty_url' => 'string'),
$add_new,
array());
}

// Build the replacement URLs
foreach ($urls as $url_id => $url)
if (isset($url['topic_id']) && isset($topicData[$url['topic_id']]))
{
$start $url['start'] != '0' || is_numeric($topicData[$url['topic_id']]['pretty_url']) ? $url['start'] . '/' '';
$urls[$url_id]['replacement'] = $modSettings['pretty_root_url'] . '/' $topicData[$url['topic_id']]['pretty_board'] . '/' $topicData[$url['topic_id']]['pretty_url'] . '/' $start $url['match1'] . $url['match3'];
}
}
return $urls;
}

// Filter board urls
function pretty_urls_board_filter($urls)
{
global $scripturl$modSettings$context;

$pattern '`' $scripturl '(.*[?;&])board=([.0-9]+)(.*)`S';
foreach ($urls as $url_id => $url)
// Split out the board URLs and replace them
if (!isset($url['replacement']))
if (preg_match($pattern$url['url'], $matches))
{
if (strpos($matches[2], '.') !== false)
list ($board_id$start) = explode('.'$matches[2]);
else
{
$board_id $matches[2];
$start '0';
}
$board_id = (int) $board_id;
$start $start != '0' $start '/' '';
$urls[$url_id]['replacement'] = $modSettings['pretty_root_url'] . '/' . (isset($context['pretty']['board_urls'][$board_id]) ? $context['pretty']['board_urls'][$board_id] : $board_id) . '/' $start $matches[1] . $matches[3];
}
return $urls;
}

// Filter profiles
function pretty_profiles_filter($urls)
{
global $boardurl$scripturl$smcFunc;

$pattern '`' $scripturl '(.*)action=profile;u=([0-9]+)(.*)`S';
$query_data = array();
foreach ($urls as $url_id => $url)
{
// Get the profile data ready to query the database with
if (!isset($url['replacement']))
if (preg_match($pattern$url['url'], $matches))
{
$urls[$url_id]['profile_id'] = (int) $matches[2];
$urls[$url_id]['match1'] = $matches[1];
$urls[$url_id]['match3'] = $matches[3];
$query_data[] = $urls[$url_id]['profile_id'];
}
}

// Query the database with these profile IDs
if (count($query_data) != 0)
{
$query $smcFunc['db_query']('''
SELECT id_member, real_name
FROM {db_prefix}members
WHERE id_member IN ({array_int:member_ids})'
,
array('member_ids' => $query_data));

$memberNames = array();
while ($row $smcFunc['db_fetch_assoc']($query))
$memberNames[$row['id_member']] = rawurlencode($row['real_name']);
$smcFunc['db_free_result']($query);

// Build the replacement URLs
foreach ($urls as $url_id => $url)
if ((isset($url['profile_id'])) && (isset($memberNames[$url['profile_id']])))
if (strpos($memberNames[$url['profile_id']], '%2F') !== false)
$urls[$url_id]['replacement'] = $boardurl '/profile/' $url['match1'] . 'user=' $memberNames[$url['profile_id']]  . $url['match3'];
else
$urls[$url_id]['replacement'] = $boardurl '/profile/' $memberNames[$url['profile_id']] . '/' $url['match1'] . $url['match3'];
}
return $urls;
}

?>


For that file.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Randem

  • Member
  • *
  • Posts: 11
    • View Profile
Re: JSON decode error: The maximum stack depth has been exceeded
« Reply #4 on: June 14, 2024, 10:06:43 pm »
Ok I will replace my file with this code. Strange, the forum states that I cannot download the file. So, I just copy and pasted the code... I will see how it works.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16481
    • View Profile
Re: JSON decode error: The maximum stack depth has been exceeded
« Reply #5 on: June 14, 2024, 10:15:16 pm »
Yeah forum downloads are restricted to people who bought products. I should figure out a way to do it for other boards for attachments
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

 

Related Topics

  Subject / Started by Replies Last post
3 Replies
6699 Views
Last post May 19, 2008, 08:30:12 pm
by ApplianceJunk
8 Replies
7265 Views
Last post May 28, 2011, 10:32:00 am
by SMFHacks
2 Replies
5207 Views
Last post August 31, 2012, 04:18:39 pm
by raffo
14 Replies
7822 Views
Last post February 06, 2015, 12:29:00 pm
by SMFHacks
0 Replies
1344 Views
Last post February 15, 2020, 07:21:33 pm
by SMFHacks

+- Recent Topics

Recent Items On Main Index by SMFHacks
July 22, 2024, 07:53:34 pm

SMF Gallery Pro 10.0 - Released! by SMFHacks
July 21, 2024, 11:18:35 am

Opportunity to use more hooks by SMFHacks
July 21, 2024, 11:08:45 am

Installation error: code not found by SMFHacks
July 20, 2024, 10:30:33 am

Installation warning: file not found by SMFHacks
July 20, 2024, 10:30:19 am

Setting a photo as invisible by SMFHacks
July 16, 2024, 11:05:06 pm

2.1.4 - Using drag and drop. by SMFHacks
July 16, 2024, 10:35:13 pm

Rate own images by SMFHacks
July 16, 2024, 10:25:55 pm

Site upgrade to 2.1 by SMFHacks
July 12, 2024, 07:47:03 am

Issues with Pretty URLs 4.1 by Randem
June 27, 2024, 07:32:22 pm

Powered by EzPortal