@@ -95,6 +95,7 @@ public function __construct( $config, Workspace $workspace, DataBuckets $buckets
9595 parent ::__construct ( $ config , $ workspace , $ buckets );
9696 $ this ->customBuckets = new DataBuckets ( [
9797 'space-id-to-prefix-map ' ,
98+ 'space-id-to-space-key-map ' ,
9899 'space-key-to-prefix-map ' ,
99100 'space-name-to-prefix-map ' ,
100101 'space-id-to-name-map ' ,
@@ -351,6 +352,9 @@ private function buildSpaceMaps( DOMDocument $dom ): void {
351352 $ this ->customBuckets ->addData (
352353 'space-key-to-prefix-map ' , $ spaceKey , $ customSpacePrefix , false , true
353354 );
355+ $ this ->customBuckets ->addData (
356+ 'space-id-to-space-key-map ' , $ spaceId , $ spaceKey , false , true
357+ );
354358 $ this ->customBuckets ->addData (
355359 'space-name-to-prefix-map ' , $ spaceName , $ customSpacePrefix , false , true
356360 );
@@ -619,6 +623,7 @@ private function buildUserMap( DOMDocument $dom ): void {
619623 */
620624 private function buildPageMaps ( DOMDocument $ dom ): void {
621625 $ spaceIdToPrefixMap = $ this ->customBuckets ->getBucketData ( 'space-id-to-prefix-map ' );
626+ $ spaceIdToSpaceKeyMap = $ this ->customBuckets ->getBucketData ( 'space-id-to-space-key-map ' );
622627 $ spaceIdHomepages = $ this ->customBuckets ->getBucketData ( 'space-id-homepages ' );
623628 $ pageIdParentPageIdMap = $ this ->customBuckets ->getBucketData ( 'page-id-to-parent-page-id-map ' );
624629 $ pageIdConfluendTitleMap = $ this ->customBuckets ->getBucketData ( 'page-id-to-confluence-title-map ' );
@@ -643,13 +648,14 @@ private function buildPageMaps( DOMDocument $dom ): void {
643648 if ( $ spaceId === null ) {
644649 return ;
645650 }
646- if ( !isset ( $ spaceIdToPrefixMap [$ spaceId ] ) ) {
651+ if ( !isset ( $ spaceIdToSpaceKeyMap [$ spaceId ] ) ) {
647652 return ;
648653 }
649- $ prefix = $ spaceIdToPrefixMap [$ spaceId ];
654+ $ spaceKey = $ spaceIdToSpaceKeyMap [$ spaceId ];
655+
650656 if (
651657 isset ( $ this ->advancedConfig ['analyzer-include-spacekey ' ] )
652- && !in_array ( strtolower ( $ prefix ), $ this ->advancedConfig ['analyzer-include-spacekey ' ] )
658+ && !in_array ( strtolower ( $ spaceKey ), $ this ->advancedConfig ['analyzer-include-spacekey ' ] )
653659 ) {
654660 return ;
655661 }
@@ -1078,7 +1084,6 @@ private function makeAttachmentReference( XMLHelper $xmlHelper, DOMElement $atta
10781084 }
10791085
10801086 private function checkTitles (): void {
1081- $ spacePrefixMap = $ this ->customBuckets ->getBucketData ( 'space-id-to-prefix-map ' );
10821087 $ pagesTitlesMap = $ this ->customBuckets ->getBucketData ( 'pages-titles-map ' );
10831088
10841089 $ hasInvalidTitles = false ;
@@ -1115,7 +1120,7 @@ private function checkTitles(): void {
11151120 $ hasInvalidNamespaces = true ;
11161121 }
11171122
1118- if ( mb_strlen ( urlencode ( $ text ) ) > 255 ) {
1123+ if ( strlen ( $ text ) > 255 ) {
11191124 $ this ->customBuckets ->addData (
11201125 'invalid-titles ' ,
11211126 'length ' , $ title ,
@@ -1124,7 +1129,7 @@ private function checkTitles(): void {
11241129 $ hasInvalidTitles = true ;
11251130 }
11261131 } else {
1127- if ( mb_strlen ( urlencode ( $ title ) ) > 255 ) {
1132+ if ( strlen ( $ title ) > 255 ) {
11281133 $ this ->customBuckets ->addData (
11291134 'invalid-titles ' ,
11301135 'length ' , $ title ,
0 commit comments