1

I'm having an issue that seems to originate in the site_pages field in the exp_sites table of my database. somehow an entry title made it's way into that array. So, i copied the contents of the field, decoded and unserialized it. Next, i took out the culprit lines. then, i made a new template, and put this script in there:

    <?php 
$uris = array(
'1' => '/',
'58' => '/sport/',
'8' => '/gokuitleg/',
'14' => '/sportsnews/',
'55' => '/about-betbaas/',
'56' => '/disclaimer/',
'2' => '/broederliefde-in-brazilie/',
'3' => '/nog-een-artikel/',
'4' => '/bla-die-bla/',
'5' => '/joepie-de-poepie/',
'9' => '/vette-wedstrijd-man-cashen/',
'13' => '/gokuitleg/veilig-online-gokken/',
'64' => '/gokuitleg/verantwoord-online-gokken/',
'65' => '/kan-sc-heerenveen-de-ban-breken-en-weer-eens-winnen/',
'67' => '/wqeqweqwe/',
'100' => '/ron-jans-puzzelt-met-spits/',
'63' => '/over-betbaas/',
'103' => '/algemene-voorwaarden/',
'105' => '/zorgt-huub-stevens-voor-een-stevens-effect-bij-vfb-stuttgart/',
'106' => '/kan-dordrecht-in-eigen-huis-winnen-van-willem-ii/',
'165' => '/bayer-leverkusen-en-gladbach-gelijkwaardig/',
'166' => '/almeria-op-papier-kansloos-tegen-real-madrid/',
'167' => '/barcelona-wil-in-spoor-real-blijven/',
'168' => '/atletico-madrid-zoekt-aansluiting-met-real-en-barca/',
'169' => '/juve-wil-koppositie-verstevigen/',
'170' => '/as-roma-wil-gat-slaan-met-genoa/',
'174' => '/milan-wilt-winnen-van-napoli/',
'186' => '/southampton-aast-op-3-punten/',
'303' => '/404/',
'304' => '/will-nigeria-successfully-defe/',
'305' => '/ajax-want-that-5th-championship/',
'306' => '/pec-zwolle-in-great-form/',
'466' => '/can-fc-dordrecht-notch-up-another-home-win/',
'552' => '/the-bundesliga-es-geht-wieder-los/',
'726' => '/eredivisie-round-21-pec-zwolle-looking-to-attack-top-3/',
'727' => '/round-19-for-the-bundesliga/',
'805' => '/the-7-golden-secrets-of-successful-sports-betting/',
'884' => '/sportsnews/ghana-vs.-equatorial-guinea-winners-and-losers-from-afcon-semi-final/',
'886' => '/sportsnews/i-wont-resign-klopp/',
'888' => '/sportsnews/ghana-3-0-equatorial-guinea-black-stars-clinch-victory-to-seal-ivory-coast-final/',
'890' => '/sportsnews/africa-cup-of-nations-semi-final-suspended-amid-fan-chaos/',
'892' => '/sportsnews/ill-regret-world-cup-final-forever-messi/',
'894' => '/sportsnews/james-undergoes-foot-surgery/',
'895' => '/sportsnews/steven-gerrards-la-galaxy-shirt-goes-on-pre-sale-for-a-whopping-114/',
'897' => '/sportsnews/kaka-scores-1st-goal-for-orlando-city-in-the-most-low-key-way-imaginable/',
'899' => '/sportsnews/do-pictures-of-smoking-partying-wilshere-rub-arsenal-fans-the-wrong-way/',
'901' => '/sportsnews/chelsea-wise-to-take-no-risks-with-cesc-fabregas-ahead-of-champions-league/',
'904' => '/sportsnews/manchester-united-transfer-news-dani-alves-admission-sparks-red-devils-rumours/',
'906' => '/sportsnews/pochettino-dismisses-lloris-to-real-madrid-psg-rumours/',
'908' => '/sportsnews/koeman-southampton-job-is-like-a-holiday/',
'917' => '/sportsnews/stans-5-point-stance-arsenal-still-in-title-race-mourinhos-master-stroke/',
'918' => '/sportsnews/chelsea-transfer-news-latest-rumours-on-mario-mandzukic-and-edinson-cavani/',
'919' => '/sportsnews/real-madrid-transfer-news-raheem-sterling-rumours-re-emerge-ahead-of-clear-out/',
'920' => '/sportsnews/liverpool-transfer-news-kit-deal-sparks-henrikh-mkhitaryan-marco-reus-rumours/',
'921' => '/sportsnews/ac-milan-stadium-plans-represent-a-step-in-the-right-direction/',
'922' => '/sportsnews/5-storylines-to-follow-in-serie-a-for-the-weekend-of-february-7/',
'923' => '/sportsnews/daniel-sturridge-video-of-raheem-sterling-dancing-worth-it-for-balotelli-cameo/',
'924' => '/sportsnews/kevin-grosskreutz-injury-updates-on-borussia-dortmund-stars-hamstring-return/',
'925' => '/sportsnews/quiet-transfer-window-is-not-a-disaster-for-manchester-united/',
'926' => '/sportsnews/manchester-united-transfer-news-adnan-januzaj-rumours-spark-marquinhos-talk/',
'927' => '/sportsnews/atletico-madrid-vs.-real-madrid-complete-positional-breakdown-of-liga-derby/',
'931' => '/can-atletico-remain-unbeaten-against-real/',
'932' => '/another-weekend-another-eredivisie-combo-banger/',
'978' => '/sportsnews/juventus-vs.-ac-milan-score-grades-reaction-from-serie-a-game/',
'990' => '/sportsnews/atletico-restore-la-liga-credentials-as-real-madrid-left-to-lick-open-wounds/',
'994' => '/sportsnews/everton-vs.-liverpool-score-grades-reaction-from-merseyside-derby/',
'1002' => '/sportsnews/epl-table-latest-week-24-results-scores-and-2015-premier-league-standings/',
'1003' => '/sportsnews/lucas-leiva-injury-updates-on-liverpool-stars-status-and-return/',
'1004' => '/sportsnews/manchester-city-vs.-hull-city-winners-and-losers-from-premier-league-game/',
'1005' => '/sportsnews/aston-villa-vs.-chelsea-winners-and-losers-from-premier-league-game/',
'1006' => '/sportsnews/epl-results-week-24-premier-league-scores-top-scorers-and-2015-table-tracker/',
'1007' => '/sportsnews/atletico-madrid-vs.-real-madrid-derby-winners-and-losers-from-la-liga/',
'1008' => '/sportsnews/aston-villa-vs.-chelsea-score-grades-and-reaction-from-premier-league-match/',
'1009' => '/sportsnews/ilkay-gundogan-clicks-borussia-dortmund-into-gear-with-a-win-at-freiburg/',
'1010' => '/sportsnews/manchester-city-vs.-hull-score-grades-and-reaction-from-premier-league-match/',
'1011' => '/sportsnews/atletico-madrid-vs.-real-madrid-derby-score-grades-reaction-from-la-liga/',
'1012' => '/sportsnews/sami-khedira-injury-updates-on-real-madrid-stars-hamstring-and-return/',
'1013' => '/sportsnews/leighton-baines-injury-updates-on-everton-stars-knee-and-return/',
'1014' => '/sportsnews/danny-rose-mousa-dembele-reward-pochettinos-faith-in-tottenhams-derby-win/',
'1015' => '/sportsnews/lack-of-santi-cazorla-influence-hurts-arsenal-in-derby-defeat-at-tottenham/',
'1016' => '/sportsnews/juventus-vs.-ac-milan-live-score-highlights-from-serie-a-game/',
'1017' => '/sportsnews/harry-kane-caps-off-statement-spurs-win-as-arsenal-make-same-old-mistakes/',
'1018' => '/sportsnews/tottenham-hotspur-vs.-arsenal-winners-and-losers-from-north-london-derby/',
'1019' => '/sportsnews/koke-injury-updates-on-atletico-madrid-stars-hamstring-and-return/',
'1022' => '/sportsnews/afcon-2015-final-score-and-twitter-reaction-for-ivory-coast-vs.-ghana/',
'1024' => '/sportsnews/athletic-bilbao-vs.-barcelona-score-grades-reaction-from-la-liga-game/',
'1026' => '/sportsnews/united-states-michael-bradley-scores-directly-off-corner-kick-vs.-panama/',
'1027' => '/sportsnews/cote-divoire-0-0-ghana-9-8-on-pens-elephants-win-africa-cup-of-nations-final/',
'1030' => '/sportsnews/athletic-bilbao-vs.-barcelona-goals-highlights-from-la-liga-match/',
'1032' => '/sportsnews/athletic-2-5-barcelona-catalans-attackers-seal-confident-win/',
'1034' => '/sportsnews/inter-3-0-palermo-guarin-and-icardi-fire-mancinis-men-to-victory/',
'1035' => '/sportsnews/live-cote-divoire-vs-ghana/',
'1037' => '/sportsnews/man-utd-draw-feels-like-defeat-noble/',
'1039' => '/sportsnews/blind-unhappy-with-blunt-man-utd-showing/',
'1045' => '/sportsnews/manchester-united-reportedly-investigating-alleged-sex-tape-with-unnamed-player/',
'1046' => '/sportsnews/harry-kane-tells-young-fan-he-wouldnt-sign-a-contract-with-manchester-united/',
'1047' => '/sportsnews/athletic-bilbao-vs.-barcelona-live-score-highlights-from-la-liga-game/',
'1048' => '/sportsnews/ghana-vs.-ivory-coast-live-score-highlights-from-afcon-final/',
'1049' => '/sportsnews/ac-milan-juventus-in-bickering-match-over-camera-angles-for-controversial-goal/',
'1050' => '/sportsnews/real-madrid-transfer-news-major-rumours-surrounding-carlo-ancelottis-squad/',
'1051' => '/sportsnews/afcon-2015-final-live-blog-ivory-coast-vs.-ghana-reaction-and-analysis/',
'1052' => '/sportsnews/barcelona-transfer-news-paul-pogba-targeted-latest-dani-alves-rumours/',
'1053' => '/sportsnews/mickey-van-der-hart-makes-awful-hilarious-blunder-in-goal-vs.-ajax/',
'1054' => '/sportsnews/why-sulley-muntari-is-under-most-pressure-for-ac-milan-following-juventus-game/',
'1055' => '/sportsnews/antoine-griezmann-fulfilling-diego-simeones-vision-of-him-at-atletico-madrid/',
'1056' => '/sportsnews/atletico-madrids-best-fan-in-india-takes-in-the-4-0-drubbing-of-real-madrid/',
'1057' => '/sportsnews/usmnt-watch-championship-pair-star-johannsson-scores-against-ajax/',
'1058' => '/sportsnews/chelsea-transfer-news-major-jose-mourinho-targets-in-rumoured-summer-raid/',
'1059' => '/sportsnews/ravel-morrisons-contract-terminated-by-west-ham-latest-details-and-reaction/',
'1060' => '/sportsnews/10-potential-summer-transfer-targets-for-chelsea/',
'1061' => '/sportsnews/west-ham-vs.-manchester-united-live-score-highlights-from-premier-league-game/',
'1063' => '/sportsnews/moyes-wants-burnley-ace-ings-at-real-sociedad/',
'1065' => '/sportsnews/barclays-under-21-premier-league-2015-table-latest-standings-results-on-feb.-9/',
'1067' => '/sportsnews/zlatan-ibrahimovics-wax-statue-is-unveiled-in-paris/',
'1068' => '/sportsnews/di-maria-very-content-at-manchester-united/',
'1070' => '/sportsnews/luiz-adriano-i-wanted-to-join-roma/',
'1072' => '/sportsnews/real-madrid-fans-angered-by-ronaldo-party-after-derby-thrashing/',
'1074' => '/sportsnews/florentino-perez-rallies-troops-as-real-madrid-reach-crisis-point/',
'1076' => '/sportsnews/transfer-talk-reus-to-sign-new-dortmund-deal/',
'1078' => '/sportsnews/aaron-ramseys-poor-form-should-be-a-major-worry-for-arsenal/',
'1079' => '/sportsnews/video-pitch-invading-dog-brings-ecuador-clash-to-a-standstill/',
'1081' => '/sportsnews/bundesliga-team-of-the-week-schurrle-starts-with-a-bang/',
'1083' => '/sportsnews/leicester-city-manager-pearson-hits-out-at-pundits-after-sacking-rumour/',
'1085' => '/sportsnews/boost-for-bayern-as-boateng-ban-cut-to-two-games/',
'1087' => '/sportsnews/watch-robbens-rocket-and-the-best-bundesliga-goals-of-the-week/',
'1089' => '/sportsnews/everything-ac-milan-fans-need-to-know-about-new-signing-mattia-destro/',
'1090' => '/sportsnews/liverpool-vs.-tottenham-brendan-rodgers-key-takeaways-from-pre-match-presser/',
'1091' => '/sportsnews/bayern-munich-stars-wear-fancy-dress-for-ana-ivanovic-bastian-schweinsteiger/',
'1092' => '/sportsnews/manchester-united-transfer-news-jackson-martinez-rumours-emerge-and-more/',
'1093' => '/sportsnews/why-arda-turan-remains-an-indispensable-part-of-atletico-madrid-project/',
'1094' => '/sportsnews/wayne-rooney-yet-to-have-a-premier-league-shot-on-target-in-2015/',
'1095' => '/sportsnews/borussia-dortmund-5-potential-replacements-should-marco-reus-leave-this-summer/',
'1096' => '/sportsnews/cristiano-ronaldo-8-reasons-why-real-madrid-should-rest-their-star-more/',
'1097' => '/sportsnews/wilfried-zaha-how-manchester-united-failed-the-12-million-england-star/',
'1098' => '/sportsnews/calls-for-manuel-pellegrini-to-leave-manchester-city-ignore-his-work-so-far/',
'1099' => '/sportsnews/epl-table-updated-premier-league-standings-fixtures-title-odds-after-week-24/',
'1100' => '/sportsnews/harry-kane-reportedly-scouted-by-real-madrid/',
'1101' => '/sportsnews/serie-a-controversy-flawed-milan-join-napoli-and-roma-in-attacking-juventus/',
'1102' => '/sportsnews/a-5-point-plan-to-ensure-lyon-fend-off-psg-in-ligue-1-title-race/',
'1103' => '/sportsnews/cristiano-ronaldo-shakes-his-head-in-anger-at-iker-casillas-conceding-goal/',
'1104' => '/sportsnews/la-liga-winners-and-losers-atletico-madrid-blow-away-real-blow-open-title-race/',
'1105' => '/sportsnews/liverpool-transfer-news-reds-watch-mauro-icardi-paulo-dybala-in-latest-rumours/',
'1106' => '/sportsnews/why-mario-gotze-and-robert-lewandowski-are-underperforming-for-bayern-munich/',
'1107' => '/can-liverpool-continue-their-unbeaten-streak/',
'1108' => '/combo-banger-for-round-25-of-the-premier-league/',
'1110' => '/the-copa-del-rey-semi-finals-are-here/',
'1112' => '/sportsnews/arsenal-vs.-leicester-city-winners-and-losers-from-premier-league-game/',
'1113' => '/sportsnews/koeman-barcelona-rumours-are-inevitable/',
'1115' => '/sportsnews/el-shaarawy-ac-milan-players-still-support-inzaghi/',
'1117' => '/sportsnews/liverpool-3-2-tottenham-late-balotelli-strike-settles-five-goal-thriller/',
'1119' => '/sportsnews/arsenal-2-1-leicester-city-walcott-on-target-for-below-par-gunners/',
'1121' => '/sportsnews/sunderland-0-2-qpr-hoops-pick-up-first-away-win/',
'1123' => '/sportsnews/hull-city-2-0-aston-villa-ndoye-stars-on-debut/',
'1125' => '/sportsnews/marquinhos-to-man-utd-we-will-see-in-the-summer-says-agent/',
'1127' => '/sportsnews/martinez-hails-jagielka-stones-defensive-partnership/',
'1129' => '/sportsnews/from-six-manchester-uniteds-to-60-gareth-bales-the-astonishing-numbers-behind-the-premier-leagues-5.14bn-tv-rights-deal/',
'1131' => '/sportsnews/tomkins-signs-new-west-ham-contract/',
'1132' => '/sportsnews/preston-north-end-fan-in-south-africa-will-sell-a-kidney-for-man-united-tickets/',
'1133' => '/sportsnews/what-the-5.136-billion-tv-deal-means-for-premier-league-fans-and-england-team/',
'1134' => '/sportsnews/chelsea-transfer-news-raphael-varane-swoop-thibaut-courtois-to-madrid-rumours/',
'1135' => '/sportsnews/liverpool-transfer-news-latest-rumours-on-vincent-enyeama-to-sign-for-reds/',
'1136' => '/sportsnews/liverpool-vs.-tottenham-hotspur-live-score-highlights-from-premier-league-game/',
'1137' => '/sportsnews/louis-van-gaal-should-look-to-counter-long-ball-united-accusation-on-the-pitch/',
'1138' => '/sportsnews/landon-donovan-girlfriend-hannah-bartell-announce-engagement/',
'1139' => '/sportsnews/arsenal-vs.-leicester-city-live-score-highlights-from-premier-league-game/',
'1140' => '/sportsnews/why-ac-milans-new-stadium-will-propel-the-rossoneri-back-to-the-top-in-europe/',
'1141' => '/sportsnews/manchester-citys-top-5-goals-this-season-james-milner-sergio-aguero-star/',
'1142' => '/sportsnews/stoke-vs.-manchester-city-team-news-preview-live-stream-and-tv-info/',
'1143' => '/sportsnews/manchester-united-transfer-news-marco-reus-contract-sparks-mats-hummels-rumours/',
'1144' => '/sportsnews/lionel-messi-celebrates-10-million-followers-on-instagram-with-special-jacket/',
'1145' => '/sportsnews/can-daniel-sturridge-and-harry-kane-be-the-perfect-attack-for-englands-future/',
'1146' => '/sportsnews/does-marco-reus-new-deal-really-secure-his-future-at-borussia-dortmund/',
'1147' => '/sportsnews/louis-van-gaal-gives-dossier-to-journalists-to-try-disproving-long-ball-critics/',
'1148' => '/sportsnews/manchester-united-vs.-burnley-louis-van-gaals-key-quotes-from-latest-presser/',
'1149' => '/sportsnews/assessing-manchester-citys-summer-signings-on-their-performance-so-far/',
'1150' => '/sportsnews/grading-atletico-madrids-defenders-on-form-so-far-this-season/',
'1151' => '/sportsnews/why-real-madrid-should-keep-denis-cheryshev-in-the-summer/'
);

$templates = array(
'1' => '12',
'8' => '28',
'13' => '28',
'14' => '19',
'55' => '13',
'56' => '13',
'58' => '12',
'2' => '11',
'3' => '11',
'4' => '11',
'5' => '11',
'9' => '12',
'64' => '28',
'65' => '11',
'67' => '11',
'100' => '11',
'63' => '27',
'103' => '27',
'105' => '11',
'106' => '11',
'165' => '11',
'166' => '11',
'167' => '11',
'167' => '11',
'168' => '11',
'169' => '11',
'170' => '11',
'174' => '11',
'186' => '11',
'303' => '32',
'304' => '11',
'305' => '11',
'306' => '11',
'466' => '11',
'552' => '11',
'726' => '11',
'727' => '11',
'805' => '11',
'884' => '19',
'886' => '19',
'888' => '19',
'890' => '19',
'892' => '19',
'894' => '19',
'895' => '19',
'897' => '19',
'899' => '19',
'901' => '19',
'904' => '19',
'906' => '19',
'908' => '19',
'917' => '19',
'918' => '19',
'919' => '19',
'920' => '19',
'921' => '19',
'922' => '19',
'923' => '19',
'924' => '19',
'925' => '19',
'926' => '19',
'927' => '19',
'931' => '11',
'932' => '11',
'978' => '19',
'990' => '19',
'994' => '19',
'1002' => '19',
'1003' => '19',
'1004' => '19',
'1005' => '19',
'1006' => '19',
'1007' => '19',
'1008' => '19',
'1009' => '19',
'1010' => '19',
'1011' => '19',
'1012' => '19',
'1013' => '19',
'1014' => '19',
'1015' => '19',
'1016' => '19',
'1017' => '19',
'1018' => '19',
'1019' => '19',
'1022' => '19',
'1024' => '19',
'1026' => '19',
'1027' => '19',
'1030' => '19',
'1032' => '19',
'1034' => '19',
'1035' => '19',
'1037' => '19',
'1039' => '19',
'1045' => '19',
'1046' => '19',
'1047' => '19',
'1048' => '19',
'1049' => '19',
'1050' => '19',
'1051' => '19',
'1052' => '19',
'1053' => '19',
'1054' => '19',
'1055' => '19',
'1056' => '19',
'1057' => '19',
'1058' => '19',
'1059' => '19',
'1060' => '19',
'1061' => '19',
'1063' => '19',
'1065' => '19',
'1067' => '19',
'1068' => '19',
'1070' => '19',
'1072' => '19',
'1074' => '19',
'1076' => '19',
'1078' => '19',
'1079' => '19',
'1081' => '19',
'1083' => '19',
'1085' => '19',
'1087' => '19',
'1089' => '19',
'1090' => '19',
'1091' => '19',
'1092' => '19',
'1093' => '19',
'1094' => '19',
'1095' => '19',
'1096' => '19',
'1097' => '19',
'1098' => '19',
'1099' => '19',
'1100' => '19',
'1101' => '19',
'1102' => '19',
'1103' => '19',
'1104' => '19',
'1105' => '19',
'1106' => '19',
'1107' => '11',
'1108' => '11',
'1110' => '11',
'1112' => '19',
'1113' => '19',
'1115' => '19',
'1117' => '19',
'1119' => '19',
'1121' => '19',
'1123' => '19',
'1125' => '19',
'1127' => '19',
'1129' => '19',
'1131' => '19',
'1132' => '19',
'1133' => '19',
'1134' => '19',
'1135' => '19',
'1136' => '19',
'1137' => '19',
'1138' => '19',
'1139' => '19',
'1140' => '19',
'1141' => '19',
'1142' => '19',
'1143' => '19',
'1144' => '19',
'1145' => '19',
'1146' => '19',
'1147' => '19',
'1148' => '19',
'1149' => '19',
'1150' => '19',
'1151' => '19'
);

$data['url'] = 'https://www.betbaas.com/';
$data['uris'] = $uris;
$data['templates'] = $templates;

//echo serialize($data);
echo base64_encode(serialize($data));

?>

Which generates a cool looking encoded string. When i insert this string into the site_pages field and save, i get a lot of errors on the frontend:

A PHP Error was encountered
Severity: Notice
Message: Undefined index: 1
Filename: core/EE_Config.php

Line Number: 356
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /path/to/codeigniter/system/core/Exceptions.php:170)
Filename: core/EE_Input.php
Line Number: 212

A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /path/to/codeigniter/system/core/Exceptions.php:170)
Filename: core/EE_Input.php
Line Number: 212

A PHP Error was encountered
Severity: Warning 
Message: Cannot modify header information - headers already sent by (output started at /path/to/codeigniter/system/core/Exceptions.php:170)
Filename: core/Common.php
Line Number: 446

I just can't seem to find what's wrong here.

0

Looks like you need to contain everything in its Site ID. So, take the code you have now, but change this:

$data['url'] = 'https://www.betbaas.com/';
$data['uris'] = $uris;
$data['templates'] = $templates;

To this:

$data = array('1' => array(
    'url' => 'https://www.betbaas.com/',
    'uris' => $uris,
    'templates' => $templates
));
0

Have you tried the script over at www.buildwithstructure.com? I realise you might not be using structure, but this script might help you as both the pages and structure modules use this field in the database. Personally I've more experience with structure over the pages module, but I've successfully used this script several times before.

You input your existing encoded value from site_pages in exp_sites and you can choose which template IDs you want to change. It then gives you a new encoded string to add back into the database.

Might be worth a shot - but backup backup backup!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.