ErrorException: Invalid argument supplied for foreach()

Debugger::handle_error (2, "Invalid argument supplied for foreach()", "/home/x11alto/public_html/apps/blog/handlers/tag.php", 33, array(13))

33/home/x11alto/public_html/apps/blog/handlers/tag.php

31. }
32.
33. foreach ($posts as $post) {
34.     $post->url '/blog/post/' $post->id '/' URLify::filter ($post->title);
35.     $post->tag_list = (strlen ($post->tags) > 0) ? explode (','$post->tags) : array ();

require ("/home/x11alto/public_html/apps/blog/handlers/tag.php")

471/home/x11alto/public_html/lib/Controller.php

469.         // Run the handler and get its output
470.         ob_start ();
471.         $res = require ($handler);
472.         $out ob_get_clean ();
473.         if (is_string ($res) && strlen ($res) > 0) {

Controller->handle ("apps/blog/handlers/tag.php", false)

175/home/x11alto/public_html/lib/FrontController.php

173.             $handler $controller->route ($_SERVER['REQUEST_URI']);
174.         }
175.         $page->body $controller->handle ($handlerfalse);
176.
177.         /**

FrontController::run ()

34/home/x11alto/public_html/index.php

32. $argc = isset ($argc) ? $argc null;
33. $argv = isset ($argv) ? $argv null;
34. return FrontController::run ($argv$argc);

Error Context

$_COOKIE = array (
    
"Country" => "GB"
);

$_SERVER = array (
    
"PATH" => "/usr/local/bin:/usr/bin:/bin"
    "TEMP" 
=> "/tmp"
    "TMP" 
=> "/tmp"
    "TMPDIR" 
=> "/tmp"
    "PWD" 
=> "/"
    "HTTP_ACCEPT" 
=> "*/*"
    "HTTP_ACCEPT_ENCODING" 
=> "gzip, br, zstd, deflate"
    "CONTENT_LENGTH" 
=> 0
    
"HTTP_COOKIE" => "Country=GB"
    "HTTP_HOST" 
=> "altonarchers.co.uk"
    "HTTP_USER_AGENT" 
=> "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
    "HTTP_X_HTTPS" 
=> 1
    
"REDIRECT_UNIQUE_ID" => "Z089oagysvQjHKL9gd4ufwABRgU"
    "REDIRECT_SCRIPT_URL" 
=> "/blog/tag/diary"
    "REDIRECT_SCRIPT_URI" 
=> "https://altonarchers.co.uk/blog/tag/diary"
    "REDIRECT_HTTPS" 
=> "on"
    "REDIRECT_SSL_TLS_SNI" 
=> "altonarchers.co.uk"
    "REDIRECT_HTTP2" 
=> "on"
    "REDIRECT_H2PUSH" 
=> "off"
    "REDIRECT_H2_PUSH" 
=> "off"
    "REDIRECT_H2_PUSHED" 
=> ""
    "REDIRECT_H2_PUSHED_ON" 
=> ""
    "REDIRECT_H2_STREAM_ID" 
=> 1
    
"REDIRECT_H2_STREAM_TAG" => "573811-142-1"
    "REDIRECT_STATUS" 
=> 200
    
"UNIQUE_ID" => "Z089oagysvQjHKL9gd4ufwABRgU"
    "SCRIPT_URL" 
=> "/blog/tag/diary"
    "SCRIPT_URI" 
=> "https://altonarchers.co.uk/blog/tag/diary"
    "HTTPS" 
=> "on"
    "SSL_TLS_SNI" 
=> "altonarchers.co.uk"
    "HTTP2" 
=> "on"
    "H2PUSH" 
=> "off"
    "H2_PUSH" 
=> "off"
    "H2_PUSHED" 
=> ""
    "H2_PUSHED_ON" 
=> ""
    "H2_STREAM_ID" 
=> 1
    
"H2_STREAM_TAG" => "573811-142-1"
    "SERVER_SIGNATURE" 
=> ""
    "SERVER_SOFTWARE" 
=> "Apache"
    "SERVER_NAME" 
=> "altonarchers.co.uk"
    "SERVER_ADDR" 
=> "185.229.21.116"
    "SERVER_PORT" 
=> 443
    
"REMOTE_ADDR" => "18.219.253.199"
    "DOCUMENT_ROOT" 
=> "/home/x11alto/public_html"
    "REQUEST_SCHEME" 
=> "https"
    "CONTEXT_PREFIX" 
=> ""
    "CONTEXT_DOCUMENT_ROOT" 
=> "/home/x11alto/public_html"
    "SERVER_ADMIN" 
=> "webmaster@altonarchers.co.uk"
    "SCRIPT_FILENAME" 
=> "/home/x11alto/public_html/index.php"
    "REMOTE_PORT" 
=> 50649
    
"REDIRECT_URL" => "/blog/tag/diary"
    "SERVER_PROTOCOL" 
=> "HTTP/2.0"
    "REQUEST_METHOD" 
=> "GET"
    "QUERY_STRING" 
=> ""
    "REQUEST_URI" 
=> "/blog/tag/diary"
    "SCRIPT_NAME" 
=> "/index.php"
    "PHP_SELF" 
=> "/index.php"
    "REQUEST_TIME_FLOAT" 
=> 1733246369.954
    
"REQUEST_TIME" => 1733246369
    
"argv" => array ()
    
"argc" => 0
);

$handler "apps/blog/handlers/tag.php";

$internal false;

$data = array ();

$page Page (
    
$head "";
    
$tail "";
    
$title "";
    
$_menu_title "";
    
$_window_title "";
    
$body "";
    
$layout "archers-main";
    
$scripts = array ();
    
$is_being_rendered false;
    
$cache_control true;
    
$preview false;
    
$id "blog";
    
$limit 10;
    
$tag "diary";
    
$num 0;
    
$offset 0;
    
$count false;
    
$last 1;
    
$more false;
    
$next 2;
);

$tpl Template (
    
$charset "UTF-8";
    
$cache_folder "cache";
    
$layouts_folder "layouts";
    
$view_folders "apps/%s/views/%s";
    
$default_layout "default";
    
$file_extension "html";
    
$controller Controller (
        
$params = array (
            
"diary"
        
);
        
$internal false;
        
$data = array ();
        
$cli false;
        
$put_data = ;
        
$app "blog";
        
$uri "blog/tag/diary";
        
$chunked false;
        
$cache false;
        
$status_code false;
);
);

$cache Cache (
    
$dir "cache/datastore";
);

$i18n I18n (
    
$language "en";
    
$locale = ;
    
$directory "lang";
    
$lang_hash = array (
        
"en" => array (
            
"Home" => "Home"
        
)
    );
    
$hash_order = array (
        
"en"
    
);
    
$charset "UTF-8";
    
$fullname "English";
    
$day_date_format "dddd, mmmm d, yyyy";
    
$short_day_date_format "ddd, mmm d";
    
$date_format "mmmm d, yyyy";
    
$short_format "mmm d";
    
$time_format "h:MMa";
    
$year_format "yyyy";
    
$fallbacks = array ();
    
$languages = array (
        
"de" => array (
            
"name" => "Deutsch"
            "code" 
=> "de"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "default" 
=> ""
            "date_format" 
=> "d mmmm yyyy"
            "short_format" 
=> "d mmm"
            "time_format" 
=> "HH:MM"
        
)
        
"en" => array (
            
"name" => "English"
            "code" 
=> "en"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> 1
        
)
        
"fr" => array (
            
"name" => "Français"
            "code" 
=> "fr"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
        
)
        
"it" => array (
            
"name" => "Italiano"
            "code" 
=> "it"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "default" 
=> ""
        
)
        
"nl" => array (
            
"name" => "Nederlands"
            "code" 
=> "nl"
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
        
)
        
"pt_br" => array (
            
"name" => "Português brasileiro"
            "code" 
=> "pt"
            "locale" 
=> "br"
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
            "date_format" 
=> "mmmm d, yyyy"
            "short_format" 
=> "mmm d"
            "time_format" 
=> "h:MMa"
        
)
        
"sl_si" => array (
            
"name" => "Slovenščina"
            "code" 
=> "sl"
            "locale" 
=> "si"
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
        
)
        
"cs" => array (
            
"name" => "Česky"
            "code" 
=> "cs"
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
            "locale" 
=> ""
            "date_format" 
=> "d.mmmm yyyy"
            "short_format" 
=> "dd.mm.yyyy"
            "time_format" 
=> "HH:MM"
        
)
        
"ru" => array (
            
"name" => "Русский"
            "code" 
=> "ru"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
            "date_format" 
=> "dd mmmm yyyy"
            "short_format" 
=> "dd mmm"
            "time_format" 
=> "HH:MM"
        
)
        
"uk" => array (
            
"name" => "Українська"
            "code" 
=> "uk"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
            "date_format" 
=> "dd mmmm yyyy"
            "short_format" 
=> "dd mmm"
            "time_format" 
=> "HH:mm"
        
)
        
"ja" => array (
            
"name" => "日本語"
            "code" 
=> "ja"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
        
)
        
"zh" => array (
            
"name" => "简体中文"
            "code" 
=> "zh"
            "locale" 
=> ""
            "charset" 
=> "UTF-8"
            "fallback" 
=> ""
            "default" 
=> ""
        
)
    );
    
$cookieName "lang";
    
$url_includes_lang false;
    
$new_request_uri "";
    
$prefix "";
    
$negotiation "http";
    
$error = ;
    
$default "en";
);

$cache_uri "_c_blog_tag_diary";

$out false;

$appconf = array (
    
"Blog" => array (
        
"title" => "News"
        "layout" 
=> "archers-main"
        "post_layout" 
=> "archers-main"
        "include_in_nav" 
=> 1
        
"preview_chars" => 750
        
"post_format" => "html"
        "comments" 
=> "comments/embed"
        "show_related_posts" 
=> ""
        "disqus_shortname" 
=> ""
    
)
    
"Social Buttons" => array (
        
"twitter" => ""
        "facebook" 
=> ""
        "google" 
=> ""
    
)
    
"Custom Handlers" => array (
        
"blog/index" => "blog/index"
        "blog/post" 
=> "blog/post"
    
)
    
"Admin" => array (
        
"handler" => "blog/admin"
        "name" 
=> "Blog Posts"
        "install" 
=> "blog/upgrade"
        "upgrade" 
=> "blog/upgrade"
        "version" 
=> "1.1.4-stable"
        "sitemap" 
=> "blog\Post::sitemap"
        "search" 
=> "blog\Post::search"
    
)
);

$preview_chars 750;

$p blog\Post (
    
$table "#prefix#blog_post";
    
$_extended_field "extra";
    
$_extended false;
    
$key "id";
    
$keyval false;
    
$data = array ();
    
$fields = array ();
    
$error false;
    
$is_new true;
    
$query_fields "*";
    
$query_order "";
    
$query_group "";
    
$query_filters = array ();
    
$query_params = array ();
    
$query_having = array ();
    
$query_from false;
    
$verify = array ();
    
$failed = array ();
);

$posts false;